[vtkusers] units in VTK

David Gobbi david.gobbi at gmail.com
Sat Oct 25 23:16:25 EDT 2014


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 <rabysam28 at gmail.com> 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 <david.gobbi at gmail.com>
> 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 <rabysam28 at gmail.com> 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 <david.gobbi at gmail.com>
>>> wrote:
>>>
>>>> On Sat, Oct 25, 2014 at 4:11 PM, Sam Raby <rabysam28 at gmail.com> 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
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141025/72f82129/attachment.html>


More information about the vtkusers mailing list