[slicer-users] transform file format

Ruben Schmidt R.Schmidt-1 at student.tudelft.nl
Tue Nov 29 07:56:57 EST 2011


giving the full, absolute paths worked! I was able to generate a DeformationField.nrrd now, but when I load that file as a volume in Slicer, it is completely black in the 3D viewer and the slices are uniformly neon green. This might suggest the deformation field to be empty / zero, even though the .nrrd file is approximately 1.5Mb large. In the end I don't need to visualize the deformation field per se, but I would like to say something about the magnitude of the deformation. So I hope there is a way to read this .nrrd file in order to play around with the deformation vectors. Any ideas?

Thanks,
Ruben 


-----Oorspronkelijk bericht-----
Van: Andriy Fedorov [mailto:fedorov at bwh.harvard.edu]
Verzonden: vr 25-11-2011 21:42
Aan: Dominik Meier
CC: Ruben Schmidt; slicer-users at bwh.harvard.edu
Onderwerp: Re: [slicer-users] transform file format
 
> I tried those commands:  /Applications/Slicer3.6.3/Slicer3 --launch> /Applications/Slicer3.6.3/lib/Slicer3/Plugins/BSplineToDeformationField> --tfm InputBSpline.tfm>   --refImage ReferenceImage.nrrd   --defImage Output_DeformationField.nrrd > and> /Applications/Slicer3.6.3/Slicer3 --launch> /Applications/Slicer3.6.3/lib/Slicer3/Plugins/BSplineToDeformationField> --help>> As for the first one, I assumed the InputBSpline.tfm and ReferenceImage.nrrd> should be located in the /Applications/Slicer3.6.3/ folder. When I run the> first command I get a prompt "unknown software exception (0x40000015)> occurred in the application at location 0x7857beae".

They don't have to be located in /Applications/Slicer3.6.3/ folder,
you just need to specify the correct path to the input files.

The module is not very friendly in reporting the errors (I just
committed exception handling to the source code). Most likely the
problem was in the incorrect paths used. Can try specifying full
paths?

> The second line doesn't show anything. No error either.>
This is a known issue of Cygwin. Please see this thread for discussion
and solution (you will need to install and use "rxvt" terminal):

http://massmail.spl.harvard.edu/public-archives/slicer-devel/2009/003018.html

I strongly suggest you get this resolved if you plan to use CLI
modules from command line. Otherwise, you will not be able to see any
messages that are printed to the console.

As to your question about the ITK B-spline transform format,
"Parameters" section in the .tfm file in the B-spline section
correspond to B-spline coefficients at each control point, and "Fixed
parameter" correspond to B-spline grid resolution, spacing, location
of the (0,0,0) control point and orientation of the grid (not
necessarily in this order). If you want to know exactly, you should
check documentation and source code for the corresponding ITK files:

http://www.itk.org/Doxygen320/html/classitk_1_1BSplineDeformableTransform.html

(see GetParameters() and GetFixedParameters() functions)


On Fri, Nov 25, 2011 at 11:41 AM, Dominik Meier <meier at bwh.harvard.edu> wrote:
> " /Applications/Slicer3.6.3/" is your path to Slicer.
> The  "InputBSpline.tfm" is the BSpline transform file that you would like to
> analyze. Can be anywhere, but give full/absolute path.
> "ReferenceImage.nrrd" is a reference image that defines the size/format of
> the deformation field output, usually you'd use the registration target
> (fixed) image for that.
> The " Output_DeformationField.nrrd" is the name of the result image to be
> generated.
>
> Functionality/Availability may depend on the version of your slicer
> installation and OS. Try most recent nightly build if 3.6.3. does not work.
> Try a
> ${SLICER}/Slicer3 --launch
> ${SLICER}/lib/Slicer3/Plugins/BSplineToDeformationField -h
> to see if that works. This may also require substantial memory depending on
> filesize, since deformation field is floating point and 4D, so the output
> file is likely 6x the size of your reference image.
> Andrey is the author and maybe can give you specific pointers.
> Best,
> Dominik
>
> On Nov 25, 2011, at 4:39 AM, Ruben Schmidt wrote:
>
> Thanks for your reply, Dominik.
>
> I tried those commands:  /Applications/Slicer3.6.3/Slicer3 --launch
> /Applications/Slicer3.6.3/lib/Slicer3/Plugins/BSplineToDeformationField
> --tfm InputBSpline.tfm
>   --refImage ReferenceImage.nrrd   --defImage Output_DeformationField.nrrd
> and
> /Applications/Slicer3.6.3/Slicer3 --launch
> /Applications/Slicer3.6.3/lib/Slicer3/Plugins/BSplineToDeformationField
> --help
>
> As for the first one, I assumed the InputBSpline.tfm and ReferenceImage.nrrd
> should be located in the /Applications/Slicer3.6.3/ folder. When I run the
> first command I get a prompt "unknown software exception (0x40000015)
> occurred in the application at location 0x7857beae".
> The second line doesn't show anything. No error either.
>
> See attachment for the exact commands I used.
>
> Ruben
>
> -----Oorspronkelijk bericht-----
> Van: Dominik Meier [mailto:meier at bwh.harvard.edu]
> Verzonden: wo 23-11-2011 19:03
> Aan: Ruben Schmidt
> CC: slicer-users at bwh.harvard.edu
> Onderwerp: Re: [slicer-users] transform file format
>
> Hi Ruben
>
> Have a look at this FAQ and the ones after that:
> http://www.slicer.org/slicerWiki/index.php/Slicer-3-6-FAQ#How_can_I_see_the_parameters_of_the_function_that_describe_a_BSpline_registration.2Fdeformation.3F
>
> Probably your best bet is to transform the .tfm into a deformation field and
> then read the displacements at the point of interest. Tools to do this are
> mentioned in adjacent FAQ. Also if you have an affine portion included in
> the .tfm you may want to remove it before calculating the deformation field
> to get actual deformation vectors only. You can do this by simply deleting
> the affine transform in a text editor.
>
> Dominik
>
>
>
> On Nov 23, 2011, at 9:12 AM, Ruben Schmidt wrote:
>
>> Hi,
>>
>> I'm using 3D Slicer Version 3.6.31.0 and I registered two volumes with the
>> Fast Nonrigid Bspline registration Transform. I'd like to interpret the
>> change of position of certain points, looking at the BSpline ITK transform
>> file (.tfm). When opened in notepad the transform file looks like this:
>>
>> #Insight Transform File V1.0
>> # Transform 0
>> Transform: BSplineDeformableTransform_double_3_3
>> Parameters: -0.543264 0.780476 -0.635213 0.755303 0.419378 3.55589e-005
>> 0.00426615 0.134459 0.094979 0.102819 -0.0325933 0.205649 0.0641266
>> 3.32429e-006 0 0 0 0 0 0 0 0 -0.00633492 -0.0324671 -0.0273389 -0.00126967
>> 0.0180009 -0.0312102 -0.00468863 -4.66394e-007 -0.0547247 -0.21644
>> -0.0975344 -0.0109937 0.204076 -0.191015 -0.0329986 -2.56133e-006 -0.0685388
>> 0.0491327 0.298163 -0.0095164 0.237217 -0.261382 -0.0469112 -1.35553e-006
>> -0.0646778 -0.134693 -0.230049 -0.414371 0.0310001 0.0784641 0.0164058
>> 1.0041e-005 -0.000330233 0.105091 -0.568059 -0.778842 -0.64285 0.0496027
>> 0.219353 5.63251e-005 0.0670795 0.688703 -0.584439 -0.715873 -0.504698
>> 0.138866 0.337946 5.11387e-005 0.0168075 0.200023 -0.0574226 -0.126103
>> -0.0602851 0.0190414 0.0516072 5.10227e-006 0 0 0 0 0 0 0 0 -0.00370536
>> -0.000438604 -0.0381948 -0.0574737 0.0529985 -0.0105227 -0.00709236
>> -5.8213e-007 -0.0135275 0.245953 0.151748 -0.150655 0.795251 0.0668059
>> -0.0501589 -8.12164e-006 0.00205979 0.414034 0.48545 0.0270515 0.452395
>> 0.00362264 -0.0240889 -6.47848e-006 0.0460265 0.400922 0.392398 -0.410713
>> 0.0052681 0.339361 0.02504 -3.1558e-006 0.0302818 0.2678 0.260855 0.141776
>> 0.260143 -0.0412013 0.00335499 4.27049e-006 0.0300862 0.242498 -0.0166836
>> 0.196753 0.0946927 -0.44898 -0.0300554 1.41737e-006 0.00780269 0.0693246
>> 0.00675035 0.00514716 -0.0166492 -0.0947293 -0.00945484 -1.14629e-006 0 0 0
>> 0 0 0 0 0 0.000387768 1.993e-005 -0.042391 -0.0706371 0.0148636 0.0281402
>> 0.00478726 2.82487e-007 0.0299827 0.237828 0.169516 -0.0483501 0.289606
>> 0.232963 0.0389836 2.055e-006 0.00685262 -0.109511 -0.0456481 0.265879
>> -0.0838635 -0.14921 0.00215552 2.69244e-006 -0.0417254 -0.384468 -0.155668
>> -0.00557991 -0.148554 -0.0516534 -0.011074 -3.38362e-006 -0.0244402 -0.17429
>> -0.0212197 -0.0533181 -0.111592 -0.0576122 -0.011072 -6.18497e-007
>> -0.0202235 -0.116473 -0.0897789 0.0844749 0.121392 -0.0179814 -0.000293799
>> 1.59356e-006 -0.00236346 -0.00980621 -0.00625583 0.0158713 0.0179566
>> -0.00747382 -0.00119532 -1.85952e-008 0 0 0 0 0 0 0 0 -0.000240606
>> -0.00385276 -0.0091568 -0.0120101 -0.00548285 0.00129124 0.000612181
>> 3.9992e-008 0.00024614 -0.0210909 -0.0448579 -0.0590502 -0.0669257
>> -0.00576813 0.00375582 4.30714e-007 -0.00561207 -0.0958429 -0.107886
>> -0.0218697 -0.118969 -0.0814704 -0.00677776 2.86991e-007 -0.00985337
>> -0.0766798 -0.0525915 0.00927459 -0.0543461 -0.0565547 -0.00657213
>> -5.06934e-007 -0.0032667 -0.0182355 -0.00835136 -0.00461511 -0.0201762
>> -0.00391333 0.00045567 2.53743e-007 -0.00292913 -0.0145098 -0.00614758
>> -0.00169927 -0.00254273 0.00324685 0.00153361 4.87957e-007 -0.000502852
>> -0.00205263 -0.000306806 0.000437897 -0.000203472 -0.000833381 -6.89736e-005
>> 2.65271e-008 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 0 0
>> FixedParameters: 8 8 8 321.282 287.194 -1572.87 14.07 13.132 18 -1 0 0 0
>> -1 0 0 0 1
>> # Transform 1
>> Transform: AffineTransform_double_3_3
>> Parameters: 1 0 0 0 1 0 0 0 1 0.0155007 0.0142507 4.54747e-013
>> FixedParameters: 0 0 0
>>
>> I guess that the Parameters of #Transform 0 denote the 3D vectors of each
>> grid node? Where can I find a description of this format. The SlicerWiki
>> refers to http://www.itk.org/ItkSoftwareGuide.pdf, but it doesn't tell me
>> how to read the .tfm output shown above.
>>
>> Thanks,
>> Ruben
>>
>> _______________________________________________
>> slicer-users mailing list
>> slicer-users at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>> To unsubscribe: send email to
>> slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the
>> subject
>
>
>
> <screenshot_slicer_cmd.JPG>
>
> _______________________________________________
> slicer-users mailing list
> slicer-users at bwh.harvard.edu
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu
> with unsubscribe as the subject
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://massmail.spl.harvard.edu/pipermail/slicer-users/attachments/20111129/6e3d2ea8/attachment.html>


More information about the slicer-users mailing list