Hello
Dear Andras and Csaba
As mentioned you, at now, I work with Slicer-4.8.1-linux-amd64 and install “Segment Registration” module. Unfortunately I can not same “Number of Points” and “Number of Cells” between two models.
This may be better to point out my purpose. Please look at my post with titled “Shape analysis between non-similar objects?” in “3D Slicer Forum”.
Briefly, suppose I have 5 groups with names A, B, C, D and E and in each group there are 8 meat samples (with size 2x2x2 cm^3 each sample, approximately). Each group was subjected to different laboratory procedures (physicochemical methods) and these procedures had a significant effect on the surface of the samples that it is recognizable by any observer.
I get MRI images from these samples separately. I put meat samples from each group on the flat surface (one chess score sheet) and after MRI acquisition, I cropped sample slice images and convert to binary segmented images using softwares such as itksnap, Seg3D and Slicer. Now I want to 3D surface analysis the effects of these procedures on the surface of these meat samples using SlicerSALT (SPHARM). At that time, Beatriz guide me that I have to check if correspondence is good across all meat samples. (I thank Beatriz for all patiently guidance). Unfortunately, I did not understand how I can match meat samples.
At now, I want to same number of points and cells between two extracted models from MRI samples.
As mentioned Andras and Csaba, I download Slicer-4.8.1-linux-amd64 and install “Segment Registration” module.
For example, I do the following steps for two samples (binary segmented images):
#1: Load data as LabelMap (WITH tick “LabelMap”) :
File menu → Add data → Choose File(s) to Add: sample1_C1_group04.nii and sample1_C1_group04.nii
#2: Load data as volume (WITHOUT tick “LabelMap”):
File menu → Add data → Choose File(s) to Add: sample1_C1_group04.nii and sample1_C1_group04.nii
Rename sample1_C1_group04.nii to Volume_sample1_C1_group04
Rename sample1_C1_group05.nii to Volume_sample1_C1_group05
#3: Segmentations module:
In “Active segmentation” → Create new Segmentation with the name MySegmentation
In “Export/import models and labelmaps” → in “Operation”, choose “Import” and in “Input type”choose “Labelmap” and select sample1_C1_group04 and in “Input node” and finally click on “Import” and again select sample1_C1_group05 in “Input node” and finally click on “Import”
#4: “Data” module:
In “Subject hierarchy” tab → right click on “MySegmentation” and click on “Export visible segments to models”
#5: “Segment Registration” module:
In “Fixed image” select Volume_sample1_C1_group04
In “Fixed segmentation” select MySegmentation
In “Fixed segment” select sample1_C1_group04
In “Moving image” select Volume_sample1_C1_group05
In “Moving segmentation” select MySegmentation
In “Moving segment” select sample1_C1_group05
in “Results” and “Applied registration on moving study, select “Deformable” defult and I can not changed it.
Click on “Perform registration”
After doing it, the options of “Applied registration on moving study” in “Results” could be changed.
At this time, I get messages in “Log messages” window; as following:
Performing registration workflow
Cropping moving volume
Pre-aligning segmentations
Fixed segment bounds: [16.945327758789062, 59.18786621093749, -94.15547943115234, -79.90632629394531, -141.16146850585938, -102.09896850585938]
Moving segment bounds: [158.5375518798828, 200.83857727050778, -95.2843017578125, -77.4457015991211, -124.57463836669922, -100.2640151977539]
Moving to fixed segment translation: [-141.62146759033203, -0.6659011840820312, -9.210891723632812]
Resampling fixed volume
Creating contour labelmaps
Performing distance based registration
Setting up result visualization
Performing registration workflow
Cropping moving volume
Pre-aligning segmentations
Fixed segment bounds: [16.945327758789062, 59.18786621093749, -94.15547943115234, -79.90632629394531, -141.16146850585938, -102.09896850585938]
Moving segment bounds: [158.5375518798828, 200.83857727050778, -95.2843017578125, -77.4457015991211, -124.57463836669922, -100.2640151977539]
Moving to fixed segment translation: [-141.62146759033203, -0.6659011840820312, -9.210891723632812]
Warning: In /home/kitware/Dashboards/Package/Slicer-481/Libs/MRML/Core/vtkMRMLTransformNode.cxx, line 1515
vtkMRMLLinearTransformNode (0x6932680): vtkMRMLTransformNode::SetAndObserveMatrixTransformToParent method is deprecated. Use vtkMRMLTransformNode::SetMatrixTransformToParent instead
_DeserializeImageGeometry: Failed to de-serialize geometry string _
ApplyTransformOnReferenceImageGeometry: Failed to get reference image geometry
Resampling fixed volume
_Found CommandLine Module, target is /home/sn/Slicer-4.8.1-linux-amd64/lib/Slicer-4.8/cli-modules/ResampleScalarVolume _
_ModuleType: CommandLineModule _
_Resample Scalar Volume command line: _
_/home/sn/Slicer-4.8.1-linux-amd64/lib/Slicer-4.8/cli-modules/ResampleScalarVolume --spacing 1,1,1 --interpolation lanczos /tmp/Slicer/CCJDG_vtkMRMLScalarVolumeNodeB.nrrd /tmp/Slicer/CCJDG_vtkMRMLScalarVolumeNodeE.nrrd _
_ _
Resample Scalar Volume completed without errors
_ _
Loaded volume from file: /tmp/Slicer/CCJDG_vtkMRMLScalarVolumeNodeE.nrrd. Dimensions: 47x20x44. Number of components: 1. Pixel type: unsigned short.
Creating contour labelmaps
Performing distance based registration
Traceback (most recent call last):
_ File “/home/sn/.config/NA-MIC/Extensions-26813/SlicerProstate/lib/Slicer-4.8/qt-scripted-modules/DistanceMapBasedRegistration.py”, line 249, in onApplyButton_
_ logic.run(self.parameterNode)_
_ File “/home/sn/.config/NA-MIC/Extensions-26813/SlicerProstate/lib/Slicer-4.8/qt-scripted-modules/DistanceMapBasedRegistration.py”, line 356, in run_
_ (bbMin,bbMax) = self.getBoundingBox(fixedLabelNodeID, movingLabelNodeID)_
_ File “/home/sn/.config/NA-MIC/Extensions-26813/SlicerProstate/lib/Slicer-4.8/qt-scripted-modules/DistanceMapBasedRegistration.py”, line 501, in getBoundingBox_
_ unionLabelImage = (cast.Execute(fixedLabelImage) + cast.Execute(movingLabelImage)) > 0_
_ File “/home/sn/Slicer-4.8.1-linux-amd64/lib/Python/lib/python2.7/site-packages/SimpleITK/SimpleITK.py”, line 4254, in add_
_ return Add( self, other )_
_ File “/home/sn/Slicer-4.8.1-linux-amd64/lib/Python/lib/python2.7/site-packages/SimpleITK/SimpleITK.py”, line 11002, in Add_
_ return SimpleITK.Add(*args)
RuntimeError: Exception thrown in SimpleITK Add: /home/kitware/Dashboards/Package/Slicer-481-package/ITKv4/Modules/Core/Common/include/itkImageToImageFilter.hxx:241:
itk::ERROR: AddImageFilter(0x6675f10): Inputs do not occupy the same physical space! _
InputImage Origin: [1.2437664e+02, 9.9558647e+01, -1.4970284e+02], InputImage_1 Origin: [-1.7810860e+01, 9.4871147e+01, -1.3251534e+02]
_ Tolerance: 1.5625000e-06
Setting up result visualization
#5: “Data” module:
In “Transform hierarchy” and in “Deformable Transform” list, right click on “Volume_sample1_C1_group05” and select “Harden transform”
#6: “Models” module:
Unfortunately, I see that “Number of Points” and “Number of Cells” are NOT the same. Why?!
Please guide me;
Shahrokh