Code Monkey home page Code Monkey logo

segmentregistration's Introduction

segmentregistration's People

Contributors

cpinter avatar darabi avatar jcfr avatar roozbehshams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

segmentregistration's Issues

Error if fixed and moving volumes are not set

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.

outputPixelSpacing of resampled volume is hard coded at 1x1x1

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?

Logic gets stuck at preAlignSegments()

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

Tables not creating again after deleting them

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


nor for the self.hausdorffTableNode node

which means that, after the clean-up, the module still thinks that those tables are in the scene but, after having calculated the coefficients, finds no table in which storing them.

This 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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.