From 52d0073088dc7f0db5e35beab6376e165c5d417c Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:32:23 +0000 Subject: [PATCH 01/12] updated ghosting script Hello @laurencejackson, @tomaroberts , I have fixed the ghosting script. The biggest problem was that the ghosting slice was always placed at random points in the image, not where it should have been, namely int the phase encoding direction. There is now a new function called get_ghosting_slice2 which selects the correct ghosting slice. I removed the old get_ghosting_slice function. I have had to change the code slightly in the main function and in the report_path if statement because it didn't plot correctly. Finally I changed the rescale_to_byte function because the original one changes the values and spreads them into a more widened histogram. I can put this back how it was but I think ideally that function will need to be changed at some point for all the hazenlib scripts. --- hazenlib/ghosting.py | 86 ++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 30 deletions(-) diff --git a/hazenlib/ghosting.py b/hazenlib/ghosting.py index 6825c624..17ab555d 100644 --- a/hazenlib/ghosting.py +++ b/hazenlib/ghosting.py @@ -45,6 +45,7 @@ def get_signal_bounding_box(array: np.ndarray): if voxel > signal_limit: signal.append(idx) + signal_column = sorted([voxel[1] for voxel in signal]) signal_row = sorted([voxel[0] for voxel in signal]) @@ -52,7 +53,6 @@ def get_signal_bounding_box(array: np.ndarray): lower_row = max(signal_row) left_column = min(signal_column) right_column = max(signal_column) - return left_column, right_column, upper_row, lower_row, @@ -111,6 +111,7 @@ def get_background_slices(background_rois, slice_radius=5): slices = [(np.array(range(roi[0]-slice_radius, roi[0]+slice_radius), dtype=np.intp)[:, np.newaxis], np.array( range(roi[1]-slice_radius, roi[1]+slice_radius), dtype=np.intp))for roi in background_rois] + return slices @@ -131,51 +132,59 @@ def get_eligible_area(signal_bounding_box, dcm, slice_radius=5): # signal is in left half eligible_columns = range(right_column + padding_from_box, dcm.Columns - slice_radius) eligible_rows = range(upper_row, lower_row) + ghost_slice = np.array( + range(right_column + padding_from_box, dcm.Columns - slice_radius), dtype=np.intp)[:, np.newaxis], np.array( + range(upper_row, lower_row) + ) else: # signal is in right half eligible_columns = range(slice_radius, left_column - padding_from_box) eligible_rows = range(upper_row, lower_row) + ghost_slice = np.array( + range(slice_radius, left_column - padding_from_box), dtype=np.intp)[:, + np.newaxis], np.array( + range(upper_row, lower_row)) else: if upper_row < dcm.Rows / 2: # signal is in top half eligible_rows = range(lower_row + padding_from_box, dcm.Rows - slice_radius) eligible_columns = range(left_column, right_column) + ghost_slice = np.array( + range(lower_row + padding_from_box, dcm.Rows - slice_radius), dtype = np.intp)[:, + np.newaxis], np.array( + range(left_column, right_column)) else: # signal is in bottom half eligible_rows = range(slice_radius, upper_row - padding_from_box) eligible_columns = range(left_column, right_column) + ghost_slice = np.array( + range(slice_radius, upper_row - padding_from_box), dtype=np.intp)[:, + np.newaxis], np.array( + range(left_column, right_column)) return eligible_columns, eligible_rows -def get_ghost_slice(signal_bounding_box, dcm, slice_radius=5): - max_mean = 0 - max_index = (0, 0) - windows = {} - arr = dcm.pixel_array - eligible_columns, eligible_rows = get_eligible_area(signal_bounding_box, dcm, slice_radius) - for idx, centre_voxel in np.ndenumerate(arr): - if idx[0] not in eligible_rows or idx[1] not in eligible_columns: - continue - else: - windows[idx] = arr[idx[0]-slice_radius:idx[0]+slice_radius, idx[1]-slice_radius:idx[1]+slice_radius] - for idx, window in windows.items(): - if np.mean(window) > max_mean: - max_mean = np.mean(window) - max_index = idx +def get_ghost_slice2(signal_bounding_box, dcm, slice_radius=5): + eligible_area = get_eligible_area(signal_bounding_box, dcm, slice_radius=slice_radius) ghost_slice = np.array( - range(max_index[1] - slice_radius, max_index[1] + slice_radius), dtype=np.intp)[:, np.newaxis], np.array( - range(max_index[0] - slice_radius, max_index[0] + slice_radius) + range(min(eligible_area[1]),max(eligible_area[1])), dtype=np.intp)[:, np.newaxis], np.array( + range(min(eligible_area[0]), max(eligible_area[0])) ) - #ghost_slice returns columns, rows of indexes return ghost_slice -def get_ghosting(dcm, plotting=False) -> dict: + + + + + + +def get_ghosting(dcm, report_path=False) -> dict: bbox = get_signal_bounding_box(dcm.pixel_array) @@ -183,23 +192,35 @@ def get_ghosting(dcm, plotting=False) -> dict: # ROIs need to be 10mmx10mm slice_radius = int(10//(2*x)) + signal_centre = [(bbox[0]+bbox[1])//2, (bbox[2]+bbox[3])//2] background_rois = get_background_rois(dcm, signal_centre) - ghost_col, ghost_row = get_ghost_slice(bbox, dcm, slice_radius=slice_radius) - ghost = dcm.pixel_array[(ghost_row, ghost_col)] + ghost_col, ghost_row = get_ghost_slice2(bbox, dcm, slice_radius=slice_radius) + ghost = dcm.pixel_array[(ghost_col, ghost_row)] signal_col, signal_row = get_signal_slice(bbox, slice_radius=slice_radius) phantom = dcm.pixel_array[(signal_row, signal_col)] - noise = np.concatenate([dcm.pixel_array[(row, col)] for col, row in get_background_slices(background_rois, slice_radius=slice_radius)]) + + + noise = np.concatenate([dcm.pixel_array[(row, col)] for col, row in get_background_slices(background_rois, slice_radius=30)]) + + + + eligible_area = get_eligible_area(bbox, dcm, slice_radius=slice_radius) + ghosting = calculate_ghost_intensity(ghost, phantom, noise) - if plotting: + if report_path: import matplotlib.pyplot as plt fig, ax = plt.subplots() x1, x2, y1, y2 = bbox - img = hazenlib.rescale_to_byte(dcm.pixel_array) + img = dcm.pixel_array + img = img.astype('float64') + #print('this is img',img) + img *= 255.0 / img.max() + #img = hazenlib.rescale_to_byte(dcm.pixel_array) img = cv.rectangle(img.copy(), (x1, y1), (x2, y2), (255, 0, 0), 1) for roi in background_rois: @@ -223,25 +244,28 @@ def get_ghosting(dcm, plotting=False) -> dict: img = cv.rectangle(img.copy(), (x1, y1), (x2, y2), (255, 0, 0), 1) ax.imshow(img) + fig.savefig(f'{report_path}.png') return fig, ghosting return None, ghosting -def main(data: list, report_path=False) -> dict: +def main(data: list, report_path = False) -> dict: results = {} - # figures = [] + #figures = [] for dcm in data: try: key = f"{dcm.SeriesDescription.replace(' ', '_')}_{dcm.EchoTime}ms_NSA-{dcm.NumberOfAverages}" + if report_path: + report_path = key except AttributeError as e: print(e) key = f"{dcm.SeriesDescription}_{dcm.SeriesNumber}" try: - fig, results[key] = get_ghosting(dcm, report_path) - if report_path: - fig.savefig(key + '.png') + fig, results[key] = get_ghosting(dcm, report_path=True) + + except Exception as e: print(f"Could not calculate the ghosting for {key} because of : {e}") @@ -251,5 +275,7 @@ def main(data: list, report_path=False) -> dict: return results + if __name__ == "__main__": main([os.path.join(sys.argv[1], i) for i in os.listdir(sys.argv[1])]) + From 23f2c5efd197c9c93841c021c868de21eb66adde Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Mon, 20 Dec 2021 09:21:20 +0000 Subject: [PATCH 02/12] updated test_ghosting I updated the test_ghosting script to work with the new ghosting function. Now the get_ghost_slice needs to be equal to the eligible area. --- tests/test_ghosting.py | 109 ++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 45 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index d631aa97..9c222216 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -18,14 +18,18 @@ class TestGhosting(unittest.TestCase): ELIGIBLE_GHOST_AREA = range(5, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), dtype=np.intp) - GHOST_SLICE = np.array(range(13 - SLICE_RADIUS, 13 + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( - range(283 - SLICE_RADIUS, 283 + SLICE_RADIUS) + GHOST_SLICE = np.array( + range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) ) - GHOSTING = (None, 0.6115742783493184) + + + GHOSTING = (None, 0.11803264099090763) def setUp(self): self.file = str(TEST_DATA_DIR / 'ghosting' / 'GHOSTING' / 'IM_0001.dcm') @@ -40,16 +44,18 @@ def test_calculate_ghost_intensity(self): with pytest.raises(Exception): hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([-10]), - phantom=np.asarray([-100]), - noise=np.asarray([-5])) + phantom=np.asarray([-100]), + noise=np.asarray([-5])) assert 5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([10]), - phantom=np.asarray([100]), - noise=np.asarray([5])) + phantom=np.asarray([100]), + noise=np.asarray([5])) + + # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), + # phantom=np.asarray([100]), + # noise=np.asarray([10])) + - assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), - phantom=np.asarray([100]), - noise=np.asarray([10])) def test_get_signal_bounding_box(self): (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box( @@ -79,44 +85,57 @@ def test_get_ghosting(self): class TestCOLPEGhosting(TestGhosting): - SIGNAL_BOUNDING_BOX = (164, 208, 166, 209) - SIGNAL_CENTRE = [186, 187] - BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] - PADDING_FROM_BOX = 30 - SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( - SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) - - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) - GHOST_SLICE = np.array(range(197 - SLICE_RADIUS, 197 + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( - range(135 - SLICE_RADIUS, 135 + SLICE_RADIUS)) - PE = "COL" - GHOSTING = (None, 0.317544586211758) + SIGNAL_BOUNDING_BOX = (164, 208, 166, 209) + SIGNAL_CENTRE = [186, 187] + BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] + PADDING_FROM_BOX = 30 + SLICE_RADIUS = 5 + ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( + SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) + + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ + :, + np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), + dtype=np.intp) + GHOST_SLICE = np.array( + range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) + ) + PE = "COL" + GHOSTING = (None, 0.015138960417776908) - def setUp(self): - self.file = str(TEST_DATA_DIR / 'ghosting' / 'PE_COL_PHANTOM_BOTTOM_RIGHT' / 'PE_COL_PHANTOM_BOTTOM_RIGHT.IMA') - self.dcm = pydicom.read_file(self.file) + def setUp(self): + self.file = str( + TEST_DATA_DIR / 'ghosting' / 'PE_COL_PHANTOM_BOTTOM_RIGHT' / 'PE_COL_PHANTOM_BOTTOM_RIGHT.IMA') + self.dcm = pydicom.read_file(self.file) class TestAxialPhilipsBroomfields(TestGhosting): - SIGNAL_BOUNDING_BOX = (217, 299, 11, 93) - SIGNAL_CENTRE = [(SIGNAL_BOUNDING_BOX[0] + SIGNAL_BOUNDING_BOX[1]) // 2, - (SIGNAL_BOUNDING_BOX[2] + SIGNAL_BOUNDING_BOX[3]) // 2] - BACKGROUND_ROIS = [(258, 264), (194, 264), (130, 264), (66, 264)] - PADDING_FROM_BOX = 30 - SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( - SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) - GHOST_SLICE = np.array(range(11 - SLICE_RADIUS, 11 + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( - range(16 - SLICE_RADIUS, 16 + SLICE_RADIUS)) + SIGNAL_BOUNDING_BOX = (217, 299, 11, 93) + SIGNAL_CENTRE = [(SIGNAL_BOUNDING_BOX[0] + SIGNAL_BOUNDING_BOX[1]) // 2, + (SIGNAL_BOUNDING_BOX[2] + SIGNAL_BOUNDING_BOX[3]) // 2] + BACKGROUND_ROIS = [(258, 264), (194, 264), (130, 264), (66, 264)] + PADDING_FROM_BOX = 30 + SLICE_RADIUS = 5 + ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( + SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ + :, + np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), + dtype=np.intp) + GHOST_SLICE = np.array( + range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) + ) + + GHOSTING = (None, 0.007246960909896829) + + def setUp(self): + self.file = str(TEST_DATA_DIR / 'ghosting' / 'GHOSTING' / 'axial_philips_broomfields.dcm') + self.dcm = pydicom.read_file(self.file) + + + + - GHOSTING = (None, 0.6244366401836245) - def setUp(self): - self.file = str(TEST_DATA_DIR / 'ghosting' / 'GHOSTING' / 'axial_philips_broomfields.dcm') - self.dcm = pydicom.read_file(self.file) \ No newline at end of file From 73c05c52cf39e63aeb4c732bce2f0ff8d58909d0 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Mon, 20 Dec 2021 09:22:55 +0000 Subject: [PATCH 03/12] changed fun name from get_ghost_slice2 to get_ghost_slice --- hazenlib/ghosting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hazenlib/ghosting.py b/hazenlib/ghosting.py index 17ab555d..d877f445 100644 --- a/hazenlib/ghosting.py +++ b/hazenlib/ghosting.py @@ -169,7 +169,7 @@ def get_eligible_area(signal_bounding_box, dcm, slice_radius=5): -def get_ghost_slice2(signal_bounding_box, dcm, slice_radius=5): +def get_ghost_slice(signal_bounding_box, dcm, slice_radius=5): eligible_area = get_eligible_area(signal_bounding_box, dcm, slice_radius=slice_radius) ghost_slice = np.array( range(min(eligible_area[1]),max(eligible_area[1])), dtype=np.intp)[:, np.newaxis], np.array( @@ -195,7 +195,7 @@ def get_ghosting(dcm, report_path=False) -> dict: signal_centre = [(bbox[0]+bbox[1])//2, (bbox[2]+bbox[3])//2] background_rois = get_background_rois(dcm, signal_centre) - ghost_col, ghost_row = get_ghost_slice2(bbox, dcm, slice_radius=slice_radius) + ghost_col, ghost_row = get_ghost_slice(bbox, dcm, slice_radius=slice_radius) ghost = dcm.pixel_array[(ghost_col, ghost_row)] signal_col, signal_row = get_signal_slice(bbox, slice_radius=slice_radius) phantom = dcm.pixel_array[(signal_row, signal_col)] From 43c64a5f030e1a5f8ee4e33201a5f49f81d9bac9 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Mon, 20 Dec 2021 10:18:27 +0000 Subject: [PATCH 04/12] Update ghosting.py --- hazenlib/ghosting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hazenlib/ghosting.py b/hazenlib/ghosting.py index d877f445..c85fe3ce 100644 --- a/hazenlib/ghosting.py +++ b/hazenlib/ghosting.py @@ -33,7 +33,7 @@ def calculate_ghost_intensity(ghost, phantom, noise) -> float: if phantom_mean < ghost_mean or phantom_mean < noise_mean: raise Exception(f"The mean phantom signal is lower than the ghost or the noise signal. This can't be the case ") - return 100 * (ghost_mean - noise_mean) / phantom_mean + return 100 * abs((ghost_mean - noise_mean)) / phantom_mean def get_signal_bounding_box(array: np.ndarray): @@ -202,7 +202,7 @@ def get_ghosting(dcm, report_path=False) -> dict: - noise = np.concatenate([dcm.pixel_array[(row, col)] for col, row in get_background_slices(background_rois, slice_radius=30)]) + noise = np.concatenate([dcm.pixel_array[(row, col)] for col, row in get_background_slices(background_rois, slice_radius=slice_radius)]) @@ -279,3 +279,4 @@ def main(data: list, report_path = False) -> dict: if __name__ == "__main__": main([os.path.join(sys.argv[1], i) for i in os.listdir(sys.argv[1])]) + From f749f4bbcbe105ada37bc6100d73df060964233d Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:32:10 +0000 Subject: [PATCH 05/12] removed the testing piece of code made redundant by the absolute value --- tests/test_ghosting.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index 9c222216..dbc0f7a9 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -51,11 +51,6 @@ def test_calculate_ghost_intensity(self): phantom=np.asarray([100]), noise=np.asarray([5])) - # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), - # phantom=np.asarray([100]), - # noise=np.asarray([10])) - - def test_get_signal_bounding_box(self): (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box( From c74b952b381d3eef77b5892ce43bf228b0bf97e3 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:40:08 +0000 Subject: [PATCH 06/12] updated indentation --- tests/test_ghosting.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index dbc0f7a9..5a6dd896 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -28,7 +28,6 @@ class TestGhosting(unittest.TestCase): range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) ) - GHOSTING = (None, 0.11803264099090763) def setUp(self): @@ -85,17 +84,15 @@ class TestCOLPEGhosting(TestGhosting): BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] PADDING_FROM_BOX = 30 SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( - SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) + ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ - :, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis], + np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) + GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) - ) + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) + PE = "COL" GHOSTING = (None, 0.015138960417776908) @@ -114,14 +111,12 @@ class TestAxialPhilipsBroomfields(TestGhosting): SLICE_RADIUS = 5 ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ - :, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis], + np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) + GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) - ) + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) GHOSTING = (None, 0.007246960909896829) From 93dee5873686cd4eb2339a0f67fdc71dcc7caa12 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:44:19 +0000 Subject: [PATCH 07/12] reverted back file because indentation caused an error --- tests/test_ghosting.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index 5a6dd896..ee4273fb 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -4,7 +4,7 @@ import pydicom import pytest -import hazenlib.ghosting as hazen_ghosting +import hazenlib.test_g as hazen_ghosting from tests import TEST_DATA_DIR @@ -28,8 +28,10 @@ class TestGhosting(unittest.TestCase): range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) ) + GHOSTING = (None, 0.11803264099090763) + def setUp(self): self.file = str(TEST_DATA_DIR / 'ghosting' / 'GHOSTING' / 'IM_0001.dcm') self.dcm = pydicom.read_file(self.file) @@ -50,6 +52,11 @@ def test_calculate_ghost_intensity(self): phantom=np.asarray([100]), noise=np.asarray([5])) + # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), + # phantom=np.asarray([100]), + # noise=np.asarray([10])) + + def test_get_signal_bounding_box(self): (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box( @@ -84,15 +91,17 @@ class TestCOLPEGhosting(TestGhosting): BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] PADDING_FROM_BOX = 30 SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) + ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( + SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis], - np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) - + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ + :, + np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), + dtype=np.intp) GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) - + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) + ) PE = "COL" GHOSTING = (None, 0.015138960417776908) @@ -111,12 +120,14 @@ class TestAxialPhilipsBroomfields(TestGhosting): SLICE_RADIUS = 5 ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis], - np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) - + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ + :, + np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), + dtype=np.intp) GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) + ) GHOSTING = (None, 0.007246960909896829) @@ -129,3 +140,5 @@ def setUp(self): + + From 4ec290912d7e283458485e666aadd544f5d1d8a4 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:49:12 +0000 Subject: [PATCH 08/12] Update test_ghosting.py --- tests/test_ghosting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index ee4273fb..4cdee5ca 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -4,7 +4,7 @@ import pydicom import pytest -import hazenlib.test_g as hazen_ghosting +import hazenlib.ghosting as hazen_ghosting from tests import TEST_DATA_DIR From c07d9fce33d893631e8c27c9b94f70eb13eda692 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:01:05 +0000 Subject: [PATCH 09/12] Removed constant outputting of image I fixed the problem where the script always outputted an image. Now it should only output if report_path == True --- hazenlib/ghosting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hazenlib/ghosting.py b/hazenlib/ghosting.py index c85fe3ce..5355786d 100644 --- a/hazenlib/ghosting.py +++ b/hazenlib/ghosting.py @@ -211,7 +211,7 @@ def get_ghosting(dcm, report_path=False) -> dict: ghosting = calculate_ghost_intensity(ghost, phantom, noise) - if report_path: + if report_path == True: import matplotlib.pyplot as plt fig, ax = plt.subplots() x1, x2, y1, y2 = bbox From a078a394cd9ea20340660f80078c171e0c76a205 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:19:24 +0000 Subject: [PATCH 10/12] updated indentation --- tests/test_ghosting.py | 54 +++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index 4cdee5ca..4325d6f8 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -8,6 +8,7 @@ from tests import TEST_DATA_DIR + class TestGhosting(unittest.TestCase): SIGNAL_BOUNDING_BOX = (252, 334, 243, 325) SIGNAL_CENTRE = [293, 284] @@ -15,19 +16,14 @@ class TestGhosting(unittest.TestCase): PADDING_FROM_BOX = 30 SLICE_RADIUS = 5 PE = 'ROW' - ELIGIBLE_GHOST_AREA = range(5, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( - SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - + ELIGIBLE_GHOST_AREA = range(5, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range(SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, - SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( - range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), dtype=np.intp) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:, np.newaxis], np.array( + range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), dtype=np.intp) GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) - ) - + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) GHOSTING = (None, 0.11803264099090763) @@ -45,23 +41,16 @@ def test_calculate_ghost_intensity(self): with pytest.raises(Exception): hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([-10]), - phantom=np.asarray([-100]), - noise=np.asarray([-5])) + phantom=np.asarray([-100]), + noise=np.asarray([-5])) assert 5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([10]), - phantom=np.asarray([100]), - noise=np.asarray([5])) - - # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), - # phantom=np.asarray([100]), - # noise=np.asarray([10])) - + phantom=np.asarray([100]), + noise=np.asarray([5])) def test_get_signal_bounding_box(self): - (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box( - self.dcm.pixel_array) - + (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box(self.dcm.pixel_array) assert (left_column, right_column, upper_row, lower_row) == self.SIGNAL_BOUNDING_BOX def test_get_signal_slice(self): @@ -94,20 +83,18 @@ class TestCOLPEGhosting(TestGhosting): ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ - :, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ + np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) + GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) - ) + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) + PE = "COL" GHOSTING = (None, 0.015138960417776908) def setUp(self): - self.file = str( - TEST_DATA_DIR / 'ghosting' / 'PE_COL_PHANTOM_BOTTOM_RIGHT' / 'PE_COL_PHANTOM_BOTTOM_RIGHT.IMA') + self.file = str(TEST_DATA_DIR / 'ghosting' / 'PE_COL_PHANTOM_BOTTOM_RIGHT' / 'PE_COL_PHANTOM_BOTTOM_RIGHT.IMA') self.dcm = pydicom.read_file(self.file) @@ -120,14 +107,11 @@ class TestAxialPhilipsBroomfields(TestGhosting): SLICE_RADIUS = 5 ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[ - :, - np.newaxis], np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS), - dtype=np.intp) + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ + np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( - range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0])) - ) + range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) GHOSTING = (None, 0.007246960909896829) From 2fe72574cc35a5c66663326b17c40643691c5dd3 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 11:01:17 +0000 Subject: [PATCH 11/12] updated indentation --- tests/test_ghosting.py | 52 +++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index 4325d6f8..ba1518a9 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -8,7 +8,6 @@ from tests import TEST_DATA_DIR - class TestGhosting(unittest.TestCase): SIGNAL_BOUNDING_BOX = (252, 334, 243, 325) SIGNAL_CENTRE = [293, 284] @@ -48,6 +47,11 @@ def test_calculate_ghost_intensity(self): phantom=np.asarray([100]), noise=np.asarray([5])) + # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), + # phantom=np.asarray([100]), + # noise=np.asarray([10])) + + def test_get_signal_bounding_box(self): (left_column, right_column, upper_row, lower_row,) = hazen_ghosting.get_signal_bounding_box(self.dcm.pixel_array) @@ -75,47 +79,47 @@ def test_get_ghosting(self): class TestCOLPEGhosting(TestGhosting): - SIGNAL_BOUNDING_BOX = (164, 208, 166, 209) - SIGNAL_CENTRE = [186, 187] - BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] - PADDING_FROM_BOX = 30 - SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( - SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) - - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ + SIGNAL_BOUNDING_BOX = (164, 208, 166, 209) + SIGNAL_CENTRE = [186, 187] + BACKGROUND_ROIS = [(64, 187), (64, 140), (64, 93), (64, 46)] + PADDING_FROM_BOX = 30 + SLICE_RADIUS = 5 + ELIGIBLE_GHOST_AREA = range(SIGNAL_BOUNDING_BOX[0], SIGNAL_BOUNDING_BOX[1]), range( + SLICE_RADIUS, SIGNAL_BOUNDING_BOX[2] - PADDING_FROM_BOX) + + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) - GHOST_SLICE = np.array( + GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) - PE = "COL" - GHOSTING = (None, 0.015138960417776908) + PE = "COL" + GHOSTING = (None, 0.015138960417776908) - def setUp(self): + def setUp(self): self.file = str(TEST_DATA_DIR / 'ghosting' / 'PE_COL_PHANTOM_BOTTOM_RIGHT' / 'PE_COL_PHANTOM_BOTTOM_RIGHT.IMA') self.dcm = pydicom.read_file(self.file) class TestAxialPhilipsBroomfields(TestGhosting): - SIGNAL_BOUNDING_BOX = (217, 299, 11, 93) - SIGNAL_CENTRE = [(SIGNAL_BOUNDING_BOX[0] + SIGNAL_BOUNDING_BOX[1]) // 2, + SIGNAL_BOUNDING_BOX = (217, 299, 11, 93) + SIGNAL_CENTRE = [(SIGNAL_BOUNDING_BOX[0] + SIGNAL_BOUNDING_BOX[1]) // 2, (SIGNAL_BOUNDING_BOX[2] + SIGNAL_BOUNDING_BOX[3]) // 2] - BACKGROUND_ROIS = [(258, 264), (194, 264), (130, 264), (66, 264)] - PADDING_FROM_BOX = 30 - SLICE_RADIUS = 5 - ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( + BACKGROUND_ROIS = [(258, 264), (194, 264), (130, 264), (66, 264)] + PADDING_FROM_BOX = 30 + SLICE_RADIUS = 5 + ELIGIBLE_GHOST_AREA = range(SLICE_RADIUS, SIGNAL_BOUNDING_BOX[0] - PADDING_FROM_BOX), range( SIGNAL_BOUNDING_BOX[2], SIGNAL_BOUNDING_BOX[3]) - SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ + SIGNAL_SLICE = np.array(range(SIGNAL_CENTRE[0] - SLICE_RADIUS, SIGNAL_CENTRE[0] + SLICE_RADIUS), dtype=np.intp)[:,np.newaxis],\ np.array(range(SIGNAL_CENTRE[1] - SLICE_RADIUS, SIGNAL_CENTRE[1] + SLICE_RADIUS),dtype=np.intp) - GHOST_SLICE = np.array( + GHOST_SLICE = np.array( range(min(ELIGIBLE_GHOST_AREA[1]), max(ELIGIBLE_GHOST_AREA[1])), dtype=np.intp)[:, np.newaxis], np.array( range(min(ELIGIBLE_GHOST_AREA[0]), max(ELIGIBLE_GHOST_AREA[0]))) - GHOSTING = (None, 0.007246960909896829) + GHOSTING = (None, 0.007246960909896829) - def setUp(self): + def setUp(self): self.file = str(TEST_DATA_DIR / 'ghosting' / 'GHOSTING' / 'axial_philips_broomfields.dcm') self.dcm = pydicom.read_file(self.file) From 9f7510f4479be91314a5963e8123c962cb924c79 Mon Sep 17 00:00:00 2001 From: Lucrezia <83493021+Lucrezia-Cester@users.noreply.github.com> Date: Tue, 21 Dec 2021 11:21:07 +0000 Subject: [PATCH 12/12] removed test made obsolete by asb value on ghosting formula --- tests/test_ghosting.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_ghosting.py b/tests/test_ghosting.py index ba1518a9..4677b84d 100644 --- a/tests/test_ghosting.py +++ b/tests/test_ghosting.py @@ -47,10 +47,6 @@ def test_calculate_ghost_intensity(self): phantom=np.asarray([100]), noise=np.asarray([5])) - # assert -5.0 == hazen_ghosting.calculate_ghost_intensity(ghost=np.asarray([5]), - # phantom=np.asarray([100]), - # noise=np.asarray([10])) - def test_get_signal_bounding_box(self):