slicerrt / segmentregistration Goto Github PK
View Code? Open in Web Editor NEW3D Slicer extension for segment registration (aka fusion, contour propagation)
License: Other
3D Slicer extension for segment registration (aka fusion, contour propagation)
License: Other
SlicerRT project home page: http://slicerrt.org SlicerRT extension page on the 3D Slicer wiki: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/SlicerRT
The following error occurs if trying to register segments without selecting fixed and moving image:
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Session start time .......: 2019-09-11 09:01:54
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Slicer version ...........: 4.10.2 (revision 28257) win-amd64 - installed release
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Operating system .........: Windows / Professional / (Build 9200) - 64-bit
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Memory ...................: 32590 MB physical, 37454 MB virtual
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - CPU ......................: GenuineIntel , 12 cores, 12 logical processors
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - VTK configuration ........: OpenGL2 rendering, TBB threading
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Developer mode enabled ...: yes
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Prefer executable CLI ....: yes
[DEBUG][Qt] 11.09.2019 09:01:54 [] (unknown:0) - Additional module paths ..:
...
[DEBUG][Qt] 11.09.2019 09:02:27 [] (unknown:0) - Switch to module: "SegmentRegistration"
[DEBUG][Qt] 11.09.2019 09:02:35 [] (unknown:0) - Switch to module: "Data"
[DEBUG][Qt] 11.09.2019 09:02:39 [] (unknown:0) - Switch to module: "SegmentRegistration"
[INFO][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:367) - Performing registration workflow
[INFO][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:376) - Cropping moving volume
[ERROR][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:378) - Unable to access MR volume or segmentation
[INFO][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:433) - Pre-aligning segmentations
[ERROR][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:435) - Invalid data selection
[INFO][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:494) - Resampling fixed volume
[ERROR][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:496) - Unable to access fixed volume
[INFO][Python] 11.09.2019 09:02:49 [Python] (C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py:528) - Creating contour labelmaps
[INFO][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Performing registration workflow
[INFO][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Cropping moving volume
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Unable to access MR volume or segmentation
[INFO][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Pre-aligning segmentations
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Invalid data selection
[INFO][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Resampling fixed volume
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Unable to access fixed volume
[INFO][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Creating contour labelmaps
[WARNING][VTK] 11.09.2019 09:02:49 [] (unknown:0) - Generic Warning: In D:\D\S\Slicer-4102\Modules\Loadable\Segmentations\Logic\vtkSlicerSegmentationsModuleLogic.cxx, line 389
vtkSlicerSegmentationsModuleLogic::CreateOrientedImageDataFromVolumeNode: Invalid volume node
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - File "C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py", line 256, in onPerformRegistration
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - if self.logic.performRegistration():
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - File "C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py", line 371, in performRegistration
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - self.createContourLabelmaps()
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - File "C:/Users/andra/AppData/Roaming/NA-MIC/Extensions-28257/SegmentRegistration/lib/Slicer-4.10/qt-scripted-modules/SegmentRegistration.py", line 560, in createContourLabelmaps
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - movingAnatomyOrientedImageData.UnRegister(None)
[CRITICAL][Stream] 11.09.2019 09:02:49 [] (unknown:0) - AttributeError: 'NoneType' object has no attribute 'UnRegister'
No registration is computed.
Me again!
The harden transform bug was fixed in the latest nightly 3D Slicer build, but I've found that I can't run this module with my data as the 'outputPixelSpacing' for the resampled volume is hard coded to 1x1x1. The volumes I'm using a whole body PET/CT, so 1x1x1 mm is perhaps a bit small and it takes 10 minutes to resample the volume on my computer.
Is there a reason this spacing was chosen? Should the spacing be the same as the moving volume?
I am having trouble using this module as it gets stuck during the 'preAlignSegments' function for an unknown reason. I have done some digging into the code, but with no luck.
I have tried to find the problem by running the module from the python interactor.
slicer.segmentRegistrationLogic.cropMovingVolumes() works fine however, slicer.segmentRegistrationLogic.prealignSegments just hangs 3D Slicer. I added a logging.info call at the start of this function but it never gets executed, so I'm lost as to how to investigate this further.
There also seem to be some bugs in the 'Run self test' code. Firstly, the scope of self.delayMs seems to be incorrect, as it is not declared when the test is run. I worked around this by replacing all the instances with 700. It now gets stuck with:
slicer.util.MRMLNodeNotFoundException: could not find nodes in the scene by name or id 'Moving_Structure_Padded-surface'
This is in Slicer 4.10.1 on MacOS
Hi. I would like to use segment registration to rigidly align vertebraes for a statistical shape model I want to make.
Could you consider giving a rigid transform as output also?
Thank you
Mauro
I am testing a script that performs several registrations and calculates the similarity coefficients for each of them.
To do so, before each registration I clear the scene using slicer.mrmlScene.Clear(0)
, and here the issue arises: the similarity coefficients are calculated only for the first run and, after the clean-up, never again.
Reading the source of the module, I see that in the calculateSegmentSimilarity
function, only the self.segmentComparisonNode
node has a check of its current presence in the scene. This check is not performed for the self.diceTableNode
node
self.hausdorffTableNode
nodeThis can be easily fixed by adding the same check on those two nodes:
if self.diceTableNode is None or self.hausdorffTableNode.GetScene() is None:
and
if self.hausdorffTableNode is None or self.hausdorffTableNode.GetScene() is None:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.