format of displacement field

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

format of displacement field

Jeff Stevenson-2
hi slicer folks, i found the polydata transform module and was wondering if there is a method to integrate ants formatted warp fields and affines to move fiber bundles into a template space?
jeff

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: format of displacement field

Andras Lasso-2
You can load ITK transform files (.h5 or .tfm extension) containing displacement field, affine, bspline, thin-plate spline transforms, or any combination of those. Simply drag-and-drop the files into Slicer and click OK in the Add data dialog.

You can also read any 3-component vector volume as displacement field into Slicer. Drag-and-drop the file into Slicer; in the Add data dialog's Description column choose "Transform", and click OK.

As far as I know, fiber bundles are model nodes, so you can apply the transform to fiber bundles in the Transforms module.

Andras

-----Original Message-----
From: slicer-users [mailto:[hidden email]] On Behalf Of Jeff Stevenson
Sent: April 3, 2017 16:14
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] format of displacement field

hi slicer folks, i found the polydata transform module and was wondering if there is a method to integrate ants formatted warp fields and affines to move fiber bundles into a template space?
jeff

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: format of displacement field

Jeff Stevenson-2
In reply to this post by Jeff Stevenson-2

hi andras, i got the affine.mat files to load and transform module accepts them and moves them as expected.

the warp.nii.gz files are displacement fields. from the ants docs:

"The values of each pixel are the displacements in physical space. So, y = u(x) + x where u(x)
is the displacement at x."
when i load them directly and enter them into slicer's polydata transform as displacement i get:

PolyData Transform (DTIProcess) command line:


/home/toddr/.config/NA-MIC/Extensions-25895/DTIProcess/lib/Slicer-4.7/cli-modules/polydatatransform --fiber_output /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp --displacement_field /tmp/Slicer/CCDHCJC_vtkMRMLVectorVolumeNodeC.nrrd --fiber_file /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp


PolyData Transform (DTIProcess) standard output:


Reading /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp


Saving fibers....

/tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp

Done!

Number of fibers saved: 0


Unrecognized file type: <?xml version="1.0"?> for file: /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp


PolyData Transform (DTIProcess) completed without errors


Error parsing XML in stream at line 1, column 1, byte index 1: not well-formed (invalid token)



Error parsing input file. ReadXMLInformation aborting.



Algorithm vtkXMLPolyDataReader(0x7026bc0) returned failure for request: vtkInformation (0x74875e0)

Debug: Off

Modified Time: 19265621

Reference Count: 1

Registered Events: (none)

Request: REQUEST_INFORMATION

ALGORITHM_AFTER_FORWARD: 1

FORWARD_DIRECTION: 0





No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).



No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).



No data to glyph!


it seems to expect an xml file of some sort... confusing.

i am not familiar with .h5 or .tfm formats.
is there a conversion tool you are aware of that makes itk .h5 or .tfm from nifti displacement files? c3d seems not to.

jeff
 




From: Andras Lasso <[hidden email]>
Sent: Monday, April 3, 2017 8:20 PM
To: Jeff Stevenson; SPL Slicer Users
Subject: RE: format of displacement field
 
You can load ITK transform files (.h5 or .tfm extension) containing displacement field, affine, bspline, thin-plate spline transforms, or any combination of those. Simply drag-and-drop the files into Slicer and click OK in the Add data dialog.

You can also read any 3-component vector volume as displacement field into Slicer. Drag-and-drop the file into Slicer; in the Add data dialog's Description column choose "Transform", and click OK.

As far as I know, fiber bundles are model nodes, so you can apply the transform to fiber bundles in the Transforms module.

Andras

-----Original Message-----
From: slicer-users [[hidden email]] On Behalf Of Jeff Stevenson
Sent: April 3, 2017 16:14
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] format of displacement field

hi slicer folks, i found the polydata transform module and was wondering if there is a method to integrate ants formatted warp fields and affines to move fiber bundles into a template space?
jeff

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: format of displacement field

Andras Lasso-2
In reply to this post by Jeff Stevenson-2

“PolyData Transform (DTIProcess)” module fails because the XML file and the implementation are inconsistent. Default polydata file format for CLIs is VTK XML polydata (.vtp). If you don’t specify a file extension then Slicer will write .vtp. However, “PolyData Transform (DTIProcess)” module can only read legacy .vtk files (it only tries to use vtkPolyDataReader). To fix this, either improve the module to be able to read from .vtp files as well (use vtkXMLPolyDataReader) or change the file extension in the module’s XML to use .vtk format.

 

It may be simpler to just use Transforms module for transforming nodes.

 

> is there a conversion tool you are aware of that makes itk .h5 or .tfm from nifti displacement files? c3d seems not to.

 

Yes. Slicer can do that: load the transform and in the save dialog choose .h5 file format.

 

Andras

 

From: Jeff Stevenson [mailto:[hidden email]]
Sent: April 4, 2017 13:24
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: format of displacement field

 

hi andras, i got the affine.mat files to load and transform module accepts them and moves them as expected.

the warp.nii.gz files are displacement fields. from the ants docs:

"The values of each pixel are the displacements in physical space. So, y = u(x) + x where u(x)

is the displacement at x."

when i load them directly and enter them into slicer's polydata transform as displacement i get:

 

PolyData Transform (DTIProcess) command line:

 

/home/toddr/.config/NA-MIC/Extensions-25895/DTIProcess/lib/Slicer-4.7/cli-modules/polydatatransform --fiber_output /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp --displacement_field /tmp/Slicer/CCDHCJC_vtkMRMLVectorVolumeNodeC.nrrd --fiber_file /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp

 

PolyData Transform (DTIProcess) standard output:

 

Reading /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp

 

Saving fibers....

/tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp

Done!

Number of fibers saved: 0



Unrecognized file type: <?xml version="1.0"?> for file: /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp



PolyData Transform (DTIProcess) completed without errors

 

Error parsing XML in stream at line 1, column 1, byte index 1: not well-formed (invalid token)

 

 

Error parsing input file. ReadXMLInformation aborting.

 

 

Algorithm vtkXMLPolyDataReader(0x7026bc0) returned failure for request: vtkInformation (0x74875e0)

Debug: Off

Modified Time: 19265621

Reference Count: 1

Registered Events: (none)

Request: REQUEST_INFORMATION

ALGORITHM_AFTER_FORWARD: 1

FORWARD_DIRECTION: 0

 

 

 

 

No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).

 

 

No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).

 

 

No data to glyph!

 

it seems to expect an xml file of some sort... confusing.

 

i am not familiar with .h5 or .tfm formats.

is there a conversion tool you are aware of that makes itk .h5 or .tfm from nifti displacement files? c3d seems not to.

 

jeff

 

 


From: Andras Lasso <[hidden email]>
Sent: Monday, April 3, 2017 8:20 PM
To: Jeff Stevenson; SPL Slicer Users
Subject: RE: format of displacement field

 

You can load ITK transform files (.h5 or .tfm extension) containing displacement field, affine, bspline, thin-plate spline transforms, or any combination of those. Simply drag-and-drop the files into Slicer and click OK in the Add data dialog.

You can also read any 3-component vector volume as displacement field into Slicer. Drag-and-drop the file into Slicer; in the Add data dialog's Description column choose "Transform", and click OK.

As far as I know, fiber bundles are model nodes, so you can apply the transform to fiber bundles in the Transforms module.

Andras

-----Original Message-----
From: slicer-users [
[hidden email]] On Behalf Of Jeff Stevenson
Sent: April 3, 2017 16:14
To: SPL Slicer Users <
[hidden email]>
Subject: [slicer-users] format of displacement field

hi slicer folks, i found the polydata transform module and was wondering if there is a method to integrate ants formatted warp fields and affines to move fiber bundles into a template space?
jeff

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to
[hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: format of displacement field

Jeff Stevenson-2
In reply to this post by Jeff Stevenson-2
thanks andras, i was able to get the transform module to recognize the warp file once i loaded it and then saved it again in h5. then reloaded it in new slicer instance and i was able to combine
the affine with the h5 warp and move the vtk file to template. any way to streamline the process programmatically? is there a cmd line for file conversion at least? thanks for your help.
jeff
 
On Apr 4, 2017, at 11:19 AM, Andras Lasso <[hidden email]> wrote:

 
It may be simpler to just use Transforms module for transforming nodes.
 
> is there a conversion tool you are aware of that makes itk .h5 or .tfm from nifti displacement files? c3d seems not to.
 
Yes. Slicer can do that: load the transform and in the save dialog choose .h5 file format.
 
Andras
 
From: Jeff Stevenson [[hidden email]] 
Sent: April 4, 2017 13:24
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: format of displacement field
 

hi andras, i got the affine.mat files to load and transform module accepts them and moves them as expected.

the warp.nii.gz files are displacement fields. from the ants docs:

"The values of each pixel are the displacements in physical space. So, y = u(x) + x where u(x)
is the displacement at x."
when i load them directly and enter them into slicer's polydata transform as displacement i get:
 

PolyData Transform (DTIProcess) command line:

 

/home/toddr/.config/NA-MIC/Extensions-25895/DTIProcess/lib/Slicer-4.7/cli-modules/polydatatransform --fiber_output /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp --displacement_field /tmp/Slicer/CCDHCJC_vtkMRMLVectorVolumeNodeC.nrrd --fiber_file /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp

 

PolyData Transform (DTIProcess) standard output:

 

Reading /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp

 

Saving fibers....

/tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeE.vtp

Done!

Number of fibers saved: 0



Unrecognized file type: <?xml version="1.0"?> for file: /tmp/Slicer/CCDHCJC_vtkMRMLFiberBundleNodeB.vtp



PolyData Transform (DTIProcess) completed without errors

 

Error parsing XML in stream at line 1, column 1, byte index 1: not well-formed (invalid token)

 

 

Error parsing input file. ReadXMLInformation aborting.

 

 

Algorithm vtkXMLPolyDataReader(0x7026bc0) returned failure for request: vtkInformation (0x74875e0)

Debug: Off

Modified Time: 19265621

Reference Count: 1

Registered Events: (none)

Request: REQUEST_INFORMATION

ALGORITHM_AFTER_FORWARD: 1

FORWARD_DIRECTION: 0

 

 

 

 

No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).

 

 

No update piece number has been set in the information for output port 0 on algorithm vtkXMLPolyDataReader(0x7026bc0).

 

 

No data to glyph!

 
it seems to expect an xml file of some sort... confusing.
 
i am not familiar with .h5 or .tfm formats.
is there a conversion tool you are aware of that makes itk .h5 or .tfm from nifti displacement files? c3d seems not to.
 
jeff
 

 


From: Andras Lasso <[hidden email]>
Sent: Monday, April 3, 2017 8:20 PM
To: Jeff Stevenson; SPL Slicer Users
Subject: RE: format of displacement field
 
You can load ITK transform files (.h5 or .tfm extension) containing displacement field, affine, bspline, thin-plate spline transforms, or any combination of those. Simply drag-and-drop the files into Slicer and click OK in the Add data dialog.

You can also read any 3-component vector volume as displacement field into Slicer. Drag-and-drop the file into Slicer; in the Add data dialog's Description column choose "Transform", and click OK.

As far as I know, fiber bundles are model nodes, so you can apply the transform to fiber bundles in the Transforms module.

Andras

-----Original Message-----
From: slicer-users [
[hidden email]] On Behalf Of Jeff Stevenson
Sent: April 3, 2017 16:14
To: SPL Slicer Users <
[hidden email]>
Subject: [slicer-users] format of displacement field

hi slicer folks, i found the polydata transform module and was wondering if there is a method to integrate ants formatted warp fields and affines to move fiber bundles into a template space?
jeff

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to 
[hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ