def test_get_predicting_input(self): test = np.array([[4, 59, 102, 85, 49, 65, 48, 85], [52, 58, 69, 70, 50, 97, 85, 63], [35, 46, 57, 84, 67, 42, 77, 67], [23, 62, 46, 79, 63, 84, 72, 88], [5, 16, 46, 56, 72, 57, 93, 80], [0, 15, 8, 22, 60, 54, 50, 52], [0, 0, 0, 16, 27, 15, 37, 33], [0, 0, 14, 2, 12, 1, 8, 19]]) print(get_predict_input(test, 4))
def get_results(base64str): # should avoid this file writing with a mimic, see later fp = open('test2.dcm', 'wb') fp.write(base64.b64decode(base64str)) fp.close() plan = dicom.read_file('test2.dcm') print(plan) data = np.array(plan.pixel_array) data = data.astype(int) print(data.shape) return get_predict_input(data, 16)