units in VTK

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

units in VTK

Sam Raby
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

-S



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

David Gobbi
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

Sam Raby
Thanks David.
If a slice of DICOM is shown in 3D scene, and a tube actor is shown along with it, now I am not sure how to set the radius of the tube to be actually 5 mm, because DICOM image is also present there in the same scene and DICOM has a sense of unit.

Should I "calibrate" the unit of the Tube? For example, I may end up concluding that if I set the radius of Tube to 1.4 then it is equal to 1 mm in DICOM image.

-S

On Sat, Oct 25, 2014 at 5:43 PM, David Gobbi <[hidden email]> wrote:
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

David Gobbi
Hi Sam,

You shouldn't have to perform any size calibration.  If you load a DICOM
file that uses millimeter units into VTK, then VTK ipso facto measures all
physical distances in millimeters.

If you have to set the radius to 1.4 in order to make it "fit" one millimeter,
that suggests that the DICOM metadata has become corrupted somehow,
either before being loaded into VTK, or after being loading into VTK.

Make sure that the DICOM PixelSpacing is correct, and make sure that
the after the DICOM is loaded into VTK, that the image data "Spacing"
is also correct.

 - David



On Sat, Oct 25, 2014 at 5:15 PM, Sam Raby <[hidden email]> wrote:
Thanks David.
If a slice of DICOM is shown in 3D scene, and a tube actor is shown along with it, now I am not sure how to set the radius of the tube to be actually 5 mm, because DICOM image is also present there in the same scene and DICOM has a sense of unit.

Should I "calibrate" the unit of the Tube? For example, I may end up concluding that if I set the radius of Tube to 1.4 then it is equal to 1 mm in DICOM image.

-S

On Sat, Oct 25, 2014 at 5:43 PM, David Gobbi <[hidden email]> wrote:
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

Sam Raby
Thanks David.

OK. Then, if the actor is not coming from a VTK class such as vtkTubeFilter, but instead it is coming from an STL file (for example it is a model of catheter designed in SolidWork), then once this actor is shown in 3D scene next to the DICOM slice, the size of the actor (which is from the STL file) should make sense without having to be worried about any sort of calibration (unless the DICOM is corrupted). 

Did I get it right?

-S

On Sat, Oct 25, 2014 at 6:52 PM, David Gobbi <[hidden email]> wrote:
Hi Sam,

You shouldn't have to perform any size calibration.  If you load a DICOM
file that uses millimeter units into VTK, then VTK ipso facto measures all
physical distances in millimeters.

If you have to set the radius to 1.4 in order to make it "fit" one millimeter,
that suggests that the DICOM metadata has become corrupted somehow,
either before being loaded into VTK, or after being loading into VTK.

Make sure that the DICOM PixelSpacing is correct, and make sure that
the after the DICOM is loaded into VTK, that the image data "Spacing"
is also correct.

 - David



On Sat, Oct 25, 2014 at 5:15 PM, Sam Raby <[hidden email]> wrote:
Thanks David.
If a slice of DICOM is shown in 3D scene, and a tube actor is shown along with it, now I am not sure how to set the radius of the tube to be actually 5 mm, because DICOM image is also present there in the same scene and DICOM has a sense of unit.

Should I "calibrate" the unit of the Tube? For example, I may end up concluding that if I set the radius of Tube to 1.4 then it is equal to 1 mm in DICOM image.

-S

On Sat, Oct 25, 2014 at 5:43 PM, David Gobbi <[hidden email]> wrote:
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

David Gobbi
Hi Sam,

Yes, your summary is correct, with one caveat: the STL file format (unlike DICOM) does not specify units, so you have to trust that whoever created the file was using millimeters as their units.

 - David


On Sat, Oct 25, 2014 at 8:51 PM, Sam Raby <[hidden email]> wrote:
Thanks David.

OK. Then, if the actor is not coming from a VTK class such as vtkTubeFilter, but instead it is coming from an STL file (for example it is a model of catheter designed in SolidWork), then once this actor is shown in 3D scene next to the DICOM slice, the size of the actor (which is from the STL file) should make sense without having to be worried about any sort of calibration (unless the DICOM is corrupted). 

Did I get it right?

-S

On Sat, Oct 25, 2014 at 6:52 PM, David Gobbi <[hidden email]> wrote:
Hi Sam,

You shouldn't have to perform any size calibration.  If you load a DICOM
file that uses millimeter units into VTK, then VTK ipso facto measures all
physical distances in millimeters.

If you have to set the radius to 1.4 in order to make it "fit" one millimeter,
that suggests that the DICOM metadata has become corrupted somehow,
either before being loaded into VTK, or after being loading into VTK.

Make sure that the DICOM PixelSpacing is correct, and make sure that
the after the DICOM is loaded into VTK, that the image data "Spacing"
is also correct.

 - David



On Sat, Oct 25, 2014 at 5:15 PM, Sam Raby <[hidden email]> wrote:
Thanks David.
If a slice of DICOM is shown in 3D scene, and a tube actor is shown along with it, now I am not sure how to set the radius of the tube to be actually 5 mm, because DICOM image is also present there in the same scene and DICOM has a sense of unit.

Should I "calibrate" the unit of the Tube? For example, I may end up concluding that if I set the radius of Tube to 1.4 then it is equal to 1 mm in DICOM image.

-S

On Sat, Oct 25, 2014 at 5:43 PM, David Gobbi <[hidden email]> wrote:
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: units in VTK

Sam Raby
Very helpful! Thank you!

-S

On Sat, Oct 25, 2014 at 10:16 PM, David Gobbi <[hidden email]> wrote:
Hi Sam,

Yes, your summary is correct, with one caveat: the STL file format (unlike DICOM) does not specify units, so you have to trust that whoever created the file was using millimeters as their units.

 - David


On Sat, Oct 25, 2014 at 8:51 PM, Sam Raby <[hidden email]> wrote:
Thanks David.

OK. Then, if the actor is not coming from a VTK class such as vtkTubeFilter, but instead it is coming from an STL file (for example it is a model of catheter designed in SolidWork), then once this actor is shown in 3D scene next to the DICOM slice, the size of the actor (which is from the STL file) should make sense without having to be worried about any sort of calibration (unless the DICOM is corrupted). 

Did I get it right?

-S

On Sat, Oct 25, 2014 at 6:52 PM, David Gobbi <[hidden email]> wrote:
Hi Sam,

You shouldn't have to perform any size calibration.  If you load a DICOM
file that uses millimeter units into VTK, then VTK ipso facto measures all
physical distances in millimeters.

If you have to set the radius to 1.4 in order to make it "fit" one millimeter,
that suggests that the DICOM metadata has become corrupted somehow,
either before being loaded into VTK, or after being loading into VTK.

Make sure that the DICOM PixelSpacing is correct, and make sure that
the after the DICOM is loaded into VTK, that the image data "Spacing"
is also correct.

 - David



On Sat, Oct 25, 2014 at 5:15 PM, Sam Raby <[hidden email]> wrote:
Thanks David.
If a slice of DICOM is shown in 3D scene, and a tube actor is shown along with it, now I am not sure how to set the radius of the tube to be actually 5 mm, because DICOM image is also present there in the same scene and DICOM has a sense of unit.

Should I "calibrate" the unit of the Tube? For example, I may end up concluding that if I set the radius of Tube to 1.4 then it is equal to 1 mm in DICOM image.

-S

On Sat, Oct 25, 2014 at 5:43 PM, David Gobbi <[hidden email]> wrote:
On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <[hidden email]> wrote:
Hi,

Consider an instant of vtkTubeFilter which has a method named "SetRadius". I was wondering how this Radius is related to millimeter?

I am using vtkTubeFilter as an example but in general I wanted to know how units are involved in actors.

The VTK filters have no units.  It's the same as looking at the
equation y = m*x + b and asking what the units are:  all you can
tell for certain is that 'y' and 'b' have the same units, and that 'm'
has units of 'y/x'.  Other than that, it's up to whoever is using the
equation to decide on the units.  VTK is the same.

If you want to use millimeters, then set the radius in millimeters.
Just make sure that you use millimeters everywhere else, too.

Also make sure that all the files you load use millimeters.  If they
don't, you'll have to convert their units before you use them in your
pipeline.

 - David





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers