Exported STL files

360 views
Skip to first unread message

mfk16

unread,
Aug 31, 2011, 1:39:32 PM8/31/11
to itksnap-users
Hi,

I really like the program, but need some help with the exported STL
files.

I overlayed an exported STL mesh on the original dicom image, using
another program, but there is a mis-alignment of the mesh with the
corresponding image dataset.

It seems I need to translate the STL file, but I'm not sure by how
much along (x,y,z). Can anyone answer this for me?

Thanks!

Paul Yushkevich

unread,
Aug 31, 2011, 5:15:42 PM8/31/11
to itksna...@googlegroups.com
The coordinates of the STL file output by SNAP are in the "physical"
coordinate system. Each 3D image volume you load into SNAP has a
transform that maps voxel coordinates into physical coordinates. Also
when you do "Tools->Image Info" in SNAP, you can see the cursor
position in physical (Nifti) coordinates.

It is possible that the program you use to view STL data does not take
this transform into account, or interprets the transform differently.
If that is the case, and you don't care about the transform, you can
change the transform in the image using C3D commands -origin, -orient,
and -spacing.

Hope this helps
Paul.

> --
> You received this message because you are subscribed to the Google Groups "itksnap-users" group.
> To post to this group, send email to itksna...@googlegroups.com.
> To unsubscribe from this group, send email to itksnap-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/itksnap-users?hl=en.
>
>

--
Paul A. Yushkevich, Ph.D.
Assistant Professor
Penn Image Computing and Science Laboratory
Department of Radiology
University of Pennsylvania

Paul Yushkevich

unread,
Aug 31, 2011, 5:16:35 PM8/31/11
to itksna...@googlegroups.com
Also c3d command -info-full prints the transform stored in the image header.

c3d is available from the itksnap.org website, under downloads.

mfk16

unread,
Sep 1, 2011, 1:24:57 PM9/1/11
to itksnap-users
Thank you for for the quick reply.

I understand that there is a transformation from voxel coordinates to
Nifiti coordinates to get the true x,y,z position of the voxel.

I'm using MATLAB to view the individual DICOM image planes in 3d
(using the 'surface' command), and I've confirmed that the calculated
x,y,z coords of the corners of my image plane are accurate by using an
independent workstation, so I'm confident in the accuracy of the
location and orientation of the display. I'm also using MATLAB to
overlay the STL on the dicomfile.

I found that I had to flip the sign of the x and y coordinates of the
generated STL file to be overlaid properly on the original dicom.

I downloaded c3d and used the -origin tag (the -origin-voxel did not
work) but the problem was still ended up being present.

Also, when I load the original DICOMs, the image orientation looks
correct, and changing the image orientation only messes things up in
the display, and I still need to negate my x and y coords.

Do you have any other suggestions?

Thanks for your help,

Matt




On Aug 31, 5:16 pm, Paul Yushkevich <pau...@mail.med.upenn.edu> wrote:
> Also c3d command -info-full prints the transform stored in the image header.
>
> c3d is available from the itksnap.org website, under downloads.
>
> On Wed, Aug 31, 2011 at 5:15 PM, Paul Yushkevich
>
>
>
>
>
>
>
>
>
> <pau...@mail.med.upenn.edu> wrote:
> > The coordinates of the STL file output by SNAP are in the "physical"
> > coordinate system. Each 3D image volume you load into SNAP has a
> > transform that maps voxel coordinates into physical coordinates. Also
> > when you do "Tools->Image Info" in SNAP, you can see the cursor
> > position in physical (Nifti) coordinates.
>
> > It is possible that the program you use to view STL data does not take
> > this transform into account, or interprets the transform differently.
> > If that is the case, and you don't care about the transform, you can
> > change the transform in the image using C3D commands -origin, -orient,
> > and -spacing.
>
> > Hope this helps
> > Paul.
>
> > On Wed, Aug 31, 2011 at 1:39 PM, mfk16 <matthew.k...@gmail.com> wrote:
> >> Hi,
>
> >> I really like the program, but need some help with the exported STL
> >> files.
>
> >> I overlayed an exported STL mesh on the original dicom image, using
> >> another program, but there is a mis-alignment of the mesh with the
> >> corresponding image dataset.
>
> >> It seems I need to translate the STL file, but I'm not sure by how
> >> much along (x,y,z).  Can anyone answer this for me?
>
> >> Thanks!
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "itksnap-users" group.
> >> To post to this group, send email to itksna...@googlegroups.com.
> >> To unsubscribe from this group, send email to itksnap-user...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/itksnap-users?hl=en.

Paul Yushkevich

unread,
Sep 2, 2011, 9:19:56 AM9/2/11
to itksna...@googlegroups.com
Matt,

I think the difference is between the NIFTI and DICOM conventions for
physical coordinate systems. NIFTI uses RAS (x:L->R, y:P->A, z:I->S)
coordinate system and DICOM uses the LPS system.

Paul.

> For more options, visit this group at http://groups.google.com/group/itksnap-users?hl=en.

Reply all
Reply to author
Forward
0 new messages