Turning off/on voxels at the intersection of two vtkimagedata

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

Turning off/on voxels at the intersection of two vtkimagedata

shadzzz90
Hi everyone,

I am working on a problem consisting of two vtkimagedata, where the first vtkimagedata represents workpiece (3D block) and other vtkimagedata represents  tool (cylindrical) in my application.
I want to turn off the voxels at the intersection of these two imagedata after that  I want to translate the tool to a next position and repeat the same thing.

I have tried few methods but no sucess! I'll be really grateful if you can help me with the easiest method to do so or at least show me direction to go.

Thanks,
Shadab

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Turning off/on voxels at the intersection of two vtkimagedata

Andras Lasso

You can do the single step of blanking out an image data with another by resampling the two images in the same coordinate system and use vtkImageMask or vtkImageMath to combine them.

 

If you wanted to simulate medical procedures (bone removal, etc.) note that a full suite of tools are available for this in 3D Slicer application (www.slicer.org) and its many extensions. They are based on VTK and fully customizable or extensible in Python and C++. You can connect to almost any position tracker device (it can be a simple webcam that tracks 2D barcodes, or a commercial surgical navigation system) using SlicerIGT extension (www.slicerigt.org) to get tool position in real-time. To remove tissue probably the simplest is to import the tool model as a segment and apply “volume masking” segment editor effect. You can even compute skill assessment metrics using PerkTutor extension (www.perktutor.org). All the programming that you need to do is writing 20-30 lines of Python code to trigger volume masking automatically when the tool position is changed. If you have any questions you can post it to https://discourse.slicer.org.

 

Andras

 

From: vtkusers <[hidden email]> On Behalf Of shadab anwar
Sent: Wednesday, January 9, 2019 2:31 PM
To: [hidden email]; [hidden email]
Subject: [vtkusers] Turning off/on voxels at the intersection of two vtkimagedata

 

Hi everyone,

 

I am working on a problem consisting of two vtkimagedata, where the first vtkimagedata represents workpiece (3D block) and other vtkimagedata represents  tool (cylindrical) in my application.

I want to turn off the voxels at the intersection of these two imagedata after that  I want to translate the tool to a next position and repeat the same thing.

 

I have tried few methods but no sucess! I'll be really grateful if you can help me with the easiest method to do so or at least show me direction to go.

 

Thanks,

Shadab


_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Turning off/on voxels at the intersection of two vtkimagedata

shadzzz90
Hey Andras,
Thank You for the quick reply!

My application is based on CAD and Machining Dynamics.
Also I would like to know the process for translating the vtkimagedata so that I can see the tool moving visually to the next position. I have tried vtkimagereslice and vtktransformfilter. The problem with vtkimagereslice is that if I rotate the model I get a truncated solid. When I use vtktransformfilter I get the output as vtkstructuredgrid instead of vtkimagedata.
I'll be happy if you can show me a direction such that I will be able to translate, rotate my imagedata (not the actor).

Just to let you know I am using C++.

Thanks,
Shadab 




On Wed, 9 Jan 2019 at 3:10 PM, Andras Lasso <[hidden email]> wrote:

You can do the single step of blanking out an image data with another by resampling the two images in the same coordinate system and use vtkImageMask or vtkImageMath to combine them.

 

If you wanted to simulate medical procedures (bone removal, etc.) note that a full suite of tools are available for this in 3D Slicer application (www.slicer.org) and its many extensions. They are based on VTK and fully customizable or extensible in Python and C++. You can connect to almost any position tracker device (it can be a simple webcam that tracks 2D barcodes, or a commercial surgical navigation system) using SlicerIGT extension (www.slicerigt.org) to get tool position in real-time. To remove tissue probably the simplest is to import the tool model as a segment and apply “volume masking” segment editor effect. You can even compute skill assessment metrics using PerkTutor extension (www.perktutor.org). All the programming that you need to do is writing 20-30 lines of Python code to trigger volume masking automatically when the tool position is changed. If you have any questions you can post it to https://discourse.slicer.org.

 

Andras

 

From: vtkusers <[hidden email]> On Behalf Of shadab anwar
Sent: Wednesday, January 9, 2019 2:31 PM
To: [hidden email]; [hidden email]
Subject: [vtkusers] Turning off/on voxels at the intersection of two vtkimagedata

 

Hi everyone,

 

I am working on a problem consisting of two vtkimagedata, where the first vtkimagedata represents workpiece (3D block) and other vtkimagedata represents  tool (cylindrical) in my application.

I want to turn off the voxels at the intersection of these two imagedata after that  I want to translate the tool to a next position and repeat the same thing.

 

I have tried few methods but no sucess! I'll be really grateful if you can help me with the easiest method to do so or at least show me direction to go.

 

Thanks,

Shadab


_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Turning off/on voxels at the intersection of two vtkimagedata

VTK - Users mailing list
TransformFilter changes the data type because vtkImageData has a fundamental limitation of being defined as being axis aligned.

David E DeMarle
Kitware, Inc.
Principal Engineer


On Wed, Jan 9, 2019 at 3:50 PM shadab anwar <[hidden email]> wrote:
Hey Andras,
Thank You for the quick reply!

My application is based on CAD and Machining Dynamics.
Also I would like to know the process for translating the vtkimagedata so that I can see the tool moving visually to the next position. I have tried vtkimagereslice and vtktransformfilter. The problem with vtkimagereslice is that if I rotate the model I get a truncated solid. When I use vtktransformfilter I get the output as vtkstructuredgrid instead of vtkimagedata.
I'll be happy if you can show me a direction such that I will be able to translate, rotate my imagedata (not the actor).

Just to let you know I am using C++.

Thanks,
Shadab 




On Wed, 9 Jan 2019 at 3:10 PM, Andras Lasso <[hidden email]> wrote:

You can do the single step of blanking out an image data with another by resampling the two images in the same coordinate system and use vtkImageMask or vtkImageMath to combine them.

 

If you wanted to simulate medical procedures (bone removal, etc.) note that a full suite of tools are available for this in 3D Slicer application (www.slicer.org) and its many extensions. They are based on VTK and fully customizable or extensible in Python and C++. You can connect to almost any position tracker device (it can be a simple webcam that tracks 2D barcodes, or a commercial surgical navigation system) using SlicerIGT extension (www.slicerigt.org) to get tool position in real-time. To remove tissue probably the simplest is to import the tool model as a segment and apply “volume masking” segment editor effect. You can even compute skill assessment metrics using PerkTutor extension (www.perktutor.org). All the programming that you need to do is writing 20-30 lines of Python code to trigger volume masking automatically when the tool position is changed. If you have any questions you can post it to https://discourse.slicer.org.

 

Andras

 

From: vtkusers <[hidden email]> On Behalf Of shadab anwar
Sent: Wednesday, January 9, 2019 2:31 PM
To: [hidden email]; [hidden email]
Subject: [vtkusers] Turning off/on voxels at the intersection of two vtkimagedata

 

Hi everyone,

 

I am working on a problem consisting of two vtkimagedata, where the first vtkimagedata represents workpiece (3D block) and other vtkimagedata represents  tool (cylindrical) in my application.

I want to turn off the voxels at the intersection of these two imagedata after that  I want to translate the tool to a next position and repeat the same thing.

 

I have tried few methods but no sucess! I'll be really grateful if you can help me with the easiest method to do so or at least show me direction to go.

 

Thanks,

Shadab

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Turning off/on voxels at the intersection of two vtkimagedata

Andras Lasso
In reply to this post by shadzzz90

There are many options. One of them is to create a “tool” image once and transformation and resample it using vtkImageResample. You do not use vktTransformFilter at all. As far as I remember, vtkImageResample has some padding options but if they are not sufficient then you can use vtkImagePadFilter to make images larger (while keeping their current content).

 

Andras

 

From: shadab anwar <[hidden email]>
Sent: Wednesday, January 9, 2019 3:50 PM
To: Andras Lasso <[hidden email]>
Cc: [hidden email]; [hidden email]
Subject: Re: [vtkusers] Turning off/on voxels at the intersection of two vtkimagedata

 

Hey Andras,

Thank You for the quick reply!

 

My application is based on CAD and Machining Dynamics.

Also I would like to know the process for translating the vtkimagedata so that I can see the tool moving visually to the next position. I have tried vtkimagereslice and vtktransformfilter. The problem with vtkimagereslice is that if I rotate the model I get a truncated solid. When I use vtktransformfilter I get the output as vtkstructuredgrid instead of vtkimagedata.

I'll be happy if you can show me a direction such that I will be able to translate, rotate my imagedata (not the actor).

 

Just to let you know I am using C++.

 

Thanks,

Shadab 

 

 

 

 

On Wed, 9 Jan 2019 at 3:10 PM, Andras Lasso <[hidden email]> wrote:

You can do the single step of blanking out an image data with another by resampling the two images in the same coordinate system and use vtkImageMask or vtkImageMath to combine them.

 

If you wanted to simulate medical procedures (bone removal, etc.) note that a full suite of tools are available for this in 3D Slicer application (www.slicer.org) and its many extensions. They are based on VTK and fully customizable or extensible in Python and C++. You can connect to almost any position tracker device (it can be a simple webcam that tracks 2D barcodes, or a commercial surgical navigation system) using SlicerIGT extension (www.slicerigt.org) to get tool position in real-time. To remove tissue probably the simplest is to import the tool model as a segment and apply “volume masking” segment editor effect. You can even compute skill assessment metrics using PerkTutor extension (www.perktutor.org). All the programming that you need to do is writing 20-30 lines of Python code to trigger volume masking automatically when the tool position is changed. If you have any questions you can post it to https://discourse.slicer.org.

 

Andras

 

From: vtkusers <[hidden email]> On Behalf Of shadab anwar
Sent: Wednesday, January 9, 2019 2:31 PM
To: [hidden email]; [hidden email]
Subject: [vtkusers] Turning off/on voxels at the intersection of two vtkimagedata

 

Hi everyone,

 

I am working on a problem consisting of two vtkimagedata, where the first vtkimagedata represents workpiece (3D block) and other vtkimagedata represents  tool (cylindrical) in my application.

I want to turn off the voxels at the intersection of these two imagedata after that  I want to translate the tool to a next position and repeat the same thing.

 

I have tried few methods but no sucess! I'll be really grateful if you can help me with the easiest method to do so or at least show me direction to go.

 

Thanks,

Shadab


_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers