Skip to content

Commit

Permalink
Merge pull request #52 from MStarmans91/development
Browse files Browse the repository at this point in the history
Fix documentation building
  • Loading branch information
MStarmans91 authored Oct 28, 2020
2 parents 6ad3abd + e5b5be8 commit da2c17d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ version: 2
sphinx:
configuration: WORC/doc/conf.py

formats: []

python:
version: 3.7
install:
- requirements: WORC/doc/doc_requirements.txt
- requirements: requirements.txt
- method: pip
path: .
system_packages: true
2 changes: 1 addition & 1 deletion WORC/WORC.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ def defaultconfig(self):
config['Preprocessing']['Clipping_Range'] = '-1000.0, 3000.0'
config['Preprocessing']['Normalize'] = 'True'
config['Preprocessing']['Normalize_ROI'] = 'Full'
config['Preprocessing']['Method'] = 'z_score'
config['Preprocessing']['ROIDetermine'] = 'Provided'
config['Preprocessing']['ROIdilate'] = 'False'
config['Preprocessing']['ROIdilateradius'] = '10'
config['Preprocessing']['Method'] = 'z_score'
config['Preprocessing']['Resampling'] = 'False'
config['Preprocessing']['Resampling_spacing'] = '1, 1, 1'
config['Preprocessing']['BiasCorrection'] = 'False'
Expand Down
3 changes: 0 additions & 3 deletions WORC/doc/doc_requirements.txt

This file was deleted.

15 changes: 13 additions & 2 deletions WORC/processing/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,19 @@ def preprocess(imagefile, config, metadata=None, mask=None):

if image.GetSpacing() == (1, 1, 1):
print('Detected 1x1x1 spacing, overwriting with DICOM metadata.')
slice_thickness = metadata[0x18, 0x50].value
pixel_spacing = metadata[0x28, 0x30].value
if [0x18, 0x50] in list(metadata.keys()):
slice_thickness = metadata[0x18, 0x50].value
elif [0x18, 0x88] in list(metadata.keys()):
# Take spacing between slices
slice_thickness = metadata[0x18, 0x88].value
else:
slice_thickness = 1.0

if [0x28, 0x30] in list(metadata.keys()):
pixel_spacing = metadata[0x28, 0x30].value
else:
pixel_spacing = [1.0, 1.0]

spacing = (float(pixel_spacing[0]),
float(pixel_spacing[1]),
float(slice_thickness))
Expand Down
20 changes: 19 additions & 1 deletion WORC/tools/Evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,25 @@ def create_links_Addon(self):
self.node_Ranked_Posteriors.inputs['estimator'] = prediction
self.node_Ranked_Posteriors.inputs['pinfo'] = pinfo

if self.parent.sources_images_train:
if self.parent.sources_images_test:
images = self.parent.sources_images_test[label].output
segmentations =\
self.parent.sources_segmentations_test[label].output
self.link_images_perc =\
self.network.create_link(images, self.node_Ranked_Percentages.inputs['images'])
self.link_images_perc.collapse = 'test'
self.link_segmentations_perc =\
self.network.create_link(segmentations, self.node_Ranked_Percentages.inputs['segmentations'])
self.link_segmentations_perc.collapse = 'test'

self.link_images_post =\
self.network.create_link(images, self.node_Ranked_Posteriors.inputs['images'])
self.link_images_post.collapse = 'test'
self.link_segmentations_post =\
self.network.create_link(segmentations, self.node_Ranked_Posteriors.inputs['segmentations'])
self.link_segmentations_post.collapse = 'test'

elif self.parent.sources_images_train:
self.link_images_perc =\
self.network.create_link(images, self.node_Ranked_Percentages.inputs['images'])
self.link_images_perc.collapse = 'train'
Expand Down

0 comments on commit da2c17d

Please sign in to comment.