View Issue Details

IDProjectCategoryView StatusLast Update
0004392Slicer4Core: Segmentationpublic2017-07-27 08:02
ReporterfepegarAssigned Topinter 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.6.2 
Target VersionSlicer 4.7.0Fixed in VersionSlicer 4.7.0 
Summary0004392: Exported segmentation is empty
Description

When trying to export a segmentation to a label map, the result is empty.

Additional Information

The colors of the segments come from a custom terminology file. This seems to be the source of the problem (see attached log). If I load the terminology before exporting, I still get the same.

TagsNo tags attached.

Activities

fepegar

fepegar

2017-07-05 18:14

reporter  

log.txt (16,826 bytes)
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Session start time .......: 2017-07-06 00:11:57
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Slicer version ...........: 4.7.0-2017-06-30 (revision 26142) macosx-amd64 - installed
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Operating system .........: Mac OS X / 10.12.5 / 16F73 - 64-bit
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Memory ...................: 8192 MB physical, 3072 MB virtual
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - CPU ......................: GenuineIntel Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz, 2 cores, 4 logical processors
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Developer mode enabled ...: yes
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Prefer executable CLI ....: yes
[DEBUG][Qt] 06.07.2017 00:11:57 [] (unknown:0) - Additional module paths ..: (none)
[DEBUG][Python] 06.07.2017 00:12:06 [Python] (/Applications/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: Annotations
[DEBUG][Python] 06.07.2017 00:12:06 [Python] (/Applications/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 06.07.2017 00:12:06 [Python] (/Applications/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 06.07.2017 00:12:00 [] (unknown:0) - Number of registered modules: 135
[DEBUG][Qt] 06.07.2017 00:12:01 [] (unknown:0) - Number of instantiated modules: 135
[DEBUG][Qt] 06.07.2017 00:12:07 [] (unknown:0) - Number of loaded modules: 135
[INFO][Stream] 06.07.2017 00:12:07 [] (unknown:0) - Loading Slicer RC file [/Users/fernando/.slicerrc.py]
[DEBUG][Qt] 06.07.2017 00:12:07 [] (unknown:0) - Switch to module:  "Blockmatching"
[WARNING][VTK] 06.07.2017 00:12:15 [vtkITKArchetypeImageSeriesVectorReaderFile (0x1289cc8c0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx:928) - Mismatch between image data and meta data number of scalar components, ignoring metada scalar range.
[INFO][VTK] 06.07.2017 00:12:15 [vtkMRMLVolumeArchetypeStorageNode (0x12b929ed0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: /Users/fernando/Dropbox/ICM/TC4_903_rgb_small.nii.gz. Dimensions: 1230x1044x1. Number of components: 3. Pixel type: unsigned char.
[DEBUG][Qt] 06.07.2017 00:12:15 [] (unknown:0) - "Volume" Reader has successfully read the file "/Users/fernando/Dropbox/ICM/TC4_903_rgb_small.nii.gz" "[0.11s]"
[DEBUG][Qt] 06.07.2017 00:12:20 [] (unknown:0) - "Segmentation" Reader has successfully read the file "/Users/fernando/Dropbox/ICM/TC4_903_segmentation.seg.nrrd" "[1.69s]"
[DEBUG][Qt] 06.07.2017 00:12:21 [] (unknown:0) - Switch to module:  "Segmentations"
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 239
GetCategoryArrayInTerminology: Failed to find terminology root for context name 'Human brainstem'
[WARNING][VTK] 06.07.2017 00:12:21 [] (unknown:0) - Generic Warning: In /Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 269
GetCategoryInTerminology: Failed to find category array in terminology 'Human brainstem'
[ERROR][VTK] 06.07.2017 00:12:21 [vtkSlicerTerminologiesModuleLogic (0x608001085be0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx:1467) - GetCategoryInTerminology: Failed to find category 'Anatomical structures' in terminology 'Human brainstem'
[CRITICAL][Qt] 06.07.2017 00:12:21 [] (unknown:0) - static bool qSlicerTerminologyNavigatorWidget::deserializeTerminologyEntry(QString, vtkSlicerTerminologyEntry *) : Failed to get terminology category
[ERROR][VTK] 06.07.2017 00:12:32 [vtkLookupTable (0x132556e50)] (/Users/kitware/Dashboards/Nightly/Slicer-0-build/VTKv7/Common/Core/vtkLookupTable.cxx:144) - Bad table range: [0, -1]
[ERROR][VTK] 06.07.2017 00:12:32 [vtkMRMLLabelMapVolumeDisplayNode (0x1326a84d0)] (/Users/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLLabelMapVolumeDisplayNode.cxx:150) - GetOutputImageData: Lookup table exists but empty!
log.txt (16,826 bytes)
HumanBrainstemTerminology.json (78,804 bytes)
TC4_903_segmentation.seg.nrrd (494,671 bytes)
TC4_903_rgb_small.nii.gz (1,554,748 bytes)
pinter

pinter

2017-07-07 18:06

developer   ~0014916

Thanks for the detailed report! Your assessment makes sense. I'll fix it shortly.

fepegar

fepegar

2017-07-10 04:21

reporter   ~0014918

Apparently I can't paste the whole thing in a note. Here's a link: https://www.dropbox.com/s/vb4nu4yswpsz3xz/HumanBrainstemTerminology.json?dl=0

pinter

pinter

2017-07-14 21:00

developer   ~0014919

Hi Fernando,
I tried to export the the attached segmentation with the terminology you last linked to, and it was successful. Is there anything to do?
(I deleted your many page comment to keep the page manageable, but your comment went along with it, sorry!)

fepegar

fepegar

2017-07-16 08:41

reporter   ~0014920

I would like to be able to do the conversion even when the Terminology file is not the same that was used to create the segmentation / when the Terminology file is not in the scene. Would that be possible?

pinter

pinter

2017-07-16 18:01

developer   ~0014921

Terminology codes should uniquely identify a terminology entry, so a different code will mean a different entry. So if your codes change, and the segmentation contains terminology information using the old codes, the link is "broken". If you want this question to be discussed in more detail, please open a discourse topic, or an issue here https://github.com/QIICR/QuantitativeReporting

I see one way out of this, however, which is similar to the way we handle the non-standard DICOM files (this is the same issue practically, as your segmentation's terminology information becomes invalid), namely that we write a simple script that matches the Category and CodeMeaning entries in the segmentation and the terminology, and overwrites the CodeValue entries based on the matches.

By the way I just imported the original json file and exported the segmentation, and although I got a lot of warning messages, the resulting labelmap seems OK!

lassoan

lassoan

2017-07-24 20:32

developer   ~0014928

Is there any code change needed and/or just a note in the module documentation?

fepegar

fepegar

2017-07-25 09:49

reporter   ~0014965

The problem happened when I tried to export the segmentation using the modified JSON. I still think that should work, even if the codes are different.

pinter

pinter

2017-07-25 10:04

developer   ~0014966

From my last comment:
"By the way I just imported the original json file and exported the segmentation, and although I got a lot of warning messages, the resulting labelmap seems OK!"
Can you please try again?

fepegar

fepegar

2017-07-25 10:16

reporter   ~0014967

Sorry, I thought you meant that you used the original terminology that was used to create the segmentation.

l = slicer.modules.terminologies.logic()
l.LoadTerminologyFromFile('/Users/fernando/Downloads/HumanBrainstemTerminology.json')
[Load volume & segmentation]
Go to Segmentations and export using the volume as reference

I get the warnings and my label map is filled with zeros. I've used the three files I originally uploaded in this issue.

I'm using today's nightly.

pinter

pinter

2017-07-25 10:42

developer   ~0014970

I used the open button in Terminologies. I just did it again, and it works. Without having your terminology loaded, and with it as well:
https://www.screencast.com/t/D5mzMZzi6D
I'll check with the python calls now.

pinter

pinter

2017-07-25 10:49

developer   ~0014971

Still worked with the terminology.

Then it struck me that you mentioned using the volume as reference. I opened Advanced, set the volume as reference, and that is when the volume became empty!
Can you please confirm that it's not the terminology that causes the issue on your computer? Use the original terminology, but don't set the reference.
Thanks!

pinter

pinter

2017-07-25 10:50

developer   ~0014972

FYI if you load the terminology from python like that it will not be cached, so you have to do that every time. But if you use the load button, then it will be cached, and loaded automatically on every startup afterwards.

fepegar

fepegar

2017-07-25 10:51

reporter   ~0014973

I watched your video and the difference is that you don't set the volume node as reference. If a reference is given, the label map is empty. If the reference is None, the labels are ok but not the geometry.

fepegar

fepegar

2017-07-25 10:53

reporter   ~0014974

I hadn't read your last two comments. So yes, the reference node seems to be what's causing trouble and not the JSON.

Thanks for the info about the button.

pinter

pinter

2017-07-25 10:59

developer   ~0014976

Well if we knew that it's not the terminology but the referece, we could have saved a lot of time. Please be very specific about the steps next time. I'll look into this issue now that I can reproduce it.

fepegar

fepegar

2017-07-25 11:04

reporter   ~0014977

Ok, next time I'll make sure to include the exact steps. I'm sorry for the trouble.

pinter

pinter

2017-07-26 14:25

developer   ~0014990

It seems that the exported labelmap is empty because the reference image is only one slice, and the oriented image data becomes empty when resampling to that reference.

When I used a transformed MRHead as reference, then the labelmap was not empty and the segments were in the right place, but stripes appeared in it, probably because as the axes were not aligned, only the voxels were filled where the voxel center of the reference volume was inside the segmentation. This may have to do something with the thin slice reference as well. I'll keep digging.

pinter

pinter

2017-07-26 14:55

developer   ~0014992

This is definitely one of the reasons the exported labelmap is empty with a single-slice volume as reference
https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkOrientedImageDataResample.cxx#L476

pinter

pinter

2017-07-26 15:02

developer   ~0014993

Last edited: 2017-07-26 15:03

View 2 revisions

I did a commit to fix this issue.
https://github.com/Slicer/Slicer/commit/195961a3ccec1b336b4ed8dda585d56704e38b1d
Can you try tomorrow's nightly? Thanks!

fepegar

fepegar

2017-07-26 15:24

reporter   ~0014994

Ok, thanks Csaba. I'll let you know what happens tomorrow.

fepegar

fepegar

2017-07-27 05:33

reporter   ~0014999

It works fine now, thank you!

pinter

pinter

2017-07-27 08:02

developer   ~0015000

Excellent, thanks! I'm closing the issue.

Issue History

Date Modified Username Field Change
2017-07-05 18:14 fepegar New Issue
2017-07-05 18:14 fepegar Status new => assigned
2017-07-05 18:14 fepegar Assigned To => pinter
2017-07-05 18:14 fepegar File Added: HumanBrainstemTerminology.json
2017-07-05 18:14 fepegar File Added: TC4_903_rgb_small.nii.gz
2017-07-05 18:14 fepegar File Added: TC4_903_segmentation.seg.nrrd
2017-07-05 18:14 fepegar File Added: log.txt
2017-07-07 18:06 pinter Note Added: 0014916
2017-07-10 04:19 fepegar OS Sierra =>
2017-07-10 04:19 fepegar OS Version 10.12.5 =>
2017-07-10 04:19 fepegar Platform Mac =>
2017-07-10 04:21 fepegar Note Added: 0014918
2017-07-14 21:00 pinter Note Added: 0014919
2017-07-16 08:41 fepegar Note Added: 0014920
2017-07-16 18:01 pinter Note Added: 0014921
2017-07-24 20:32 lassoan Note Added: 0014928
2017-07-24 20:58 lassoan Target Version => Slicer 4.7.0
2017-07-25 09:49 fepegar Note Added: 0014965
2017-07-25 10:04 pinter Note Added: 0014966
2017-07-25 10:16 fepegar Note Added: 0014967
2017-07-25 10:42 pinter Note Added: 0014970
2017-07-25 10:49 pinter Note Added: 0014971
2017-07-25 10:50 pinter Note Added: 0014972
2017-07-25 10:51 fepegar Note Added: 0014973
2017-07-25 10:53 fepegar Note Added: 0014974
2017-07-25 10:59 pinter Note Added: 0014976
2017-07-25 11:04 fepegar Note Added: 0014977
2017-07-26 14:25 pinter Note Added: 0014990
2017-07-26 14:55 pinter Note Added: 0014992
2017-07-26 15:02 pinter Note Added: 0014993
2017-07-26 15:03 pinter Note Edited: 0014993 View Revisions
2017-07-26 15:08 pinter Status assigned => resolved
2017-07-26 15:08 pinter Resolution open => fixed
2017-07-26 15:08 pinter Fixed in Version => Slicer 4.7.0
2017-07-26 15:24 fepegar Note Added: 0014994
2017-07-27 05:33 fepegar Note Added: 0014999
2017-07-27 08:02 pinter Status resolved => closed
2017-07-27 08:02 pinter Note Added: 0015000