Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
Default DICOM origin to [0, 0, 0]
Browse files Browse the repository at this point in the history
  • Loading branch information
WGierke committed Dec 3, 2017
1 parent 411ae05 commit 28c60c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions prediction/src/preprocess/load_ct.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ def extract_origin_mhd(self):
# the default axes order which is used is: (z, y, x)
return self.meta.GetOrigin()[::-1]

def extract_origin_dicom(self):
return [0]*3

def non_copy_constructor(self, meta_instance):
self.meta = meta_instance.meta
self.spacing = meta_instance.spacing
Expand All @@ -167,6 +170,7 @@ def __init__(self, meta):
if dicom_meta:
# list of methods for DICOM meta
self.spacing = self.extract_spacing_dcm()
self.origin = self.extract_origin_dicom()
elif mhd_meta:
# list of methods for MetaImage meta
self.spacing = self.extract_spacing_mhd()
Expand Down
2 changes: 1 addition & 1 deletion prediction/src/tests/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def test_classify_predict_load(metaimage_path, model_path):


def test_classify_dicom(dicom_paths, nodule_locations, model_path):
predicted = trained_model.predict(dicom_paths, nodule_locations, model_path)
predicted = trained_model.predict(dicom_paths[0], nodule_locations, model_path)
assert predicted
assert 0 <= predicted[0]['p_concerning'] <= 1

Expand Down

0 comments on commit 28c60c9

Please sign in to comment.