Oblique slice of 3D image data

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

Oblique slice of 3D image data

Tijmen Klein
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Jothy
I would recommed vtkImageReslice to cut the imageData and to use vtkImagemapToColors with appropriate vtkLookUpTable , then map your data.

Jothy

On Tue, Sep 20, 2011 at 12:40 PM, Tijmen Klein <[hidden email]> wrote:
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers




--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK


_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Tijmen Klein
Thank you for the thip, the combination of vtkImageReslice -> vtkImagemapToColors indeed gives an output that looks what I would expect :) But I am having troubles setting the correct value for setResliceAxesDirectionCosines(), since I only have an origin and normal (no point1 point2).
Right now I just set the origin (SetResliceAxesOrigin()), but I don't set the Direction. One strange thing that I am seeing, is that the plane is rendered outside the original dataset... Would this be because I don't set a proper direction? Or could it have some other reason?

Cheers,
Tijmen

On Tue, Sep 20, 2011 at 1:50 PM, Jothy <[hidden email]> wrote:
I would recommed vtkImageReslice to cut the imageData and to use vtkImagemapToColors with appropriate vtkLookUpTable , then map your data.

Jothy

On Tue, Sep 20, 2011 at 12:40 PM, Tijmen Klein <[hidden email]> wrote:
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers




--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK



_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Jothy
You could create a vtkMatrix4x4  and set this matrix to vtkImageReslice->SetResliceAxes(matrix4x4).

Jothy

On Tue, Sep 20, 2011 at 1:32 PM, Tijmen Klein <[hidden email]> wrote:
Thank you for the thip, the combination of vtkImageReslice -> vtkImagemapToColors indeed gives an output that looks what I would expect :) But I am having troubles setting the correct value for setResliceAxesDirectionCosines(), since I only have an origin and normal (no point1 point2).
Right now I just set the origin (SetResliceAxesOrigin()), but I don't set the Direction. One strange thing that I am seeing, is that the plane is rendered outside the original dataset... Would this be because I don't set a proper direction? Or could it have some other reason?

Cheers,
Tijmen


On Tue, Sep 20, 2011 at 1:50 PM, Jothy <[hidden email]> wrote:
I would recommed vtkImageReslice to cut the imageData and to use vtkImagemapToColors with appropriate vtkLookUpTable , then map your data.

Jothy

On Tue, Sep 20, 2011 at 12:40 PM, Tijmen Klein <[hidden email]> wrote:
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers




--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK





--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK


_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Tijmen Klein
Could you elaborate a bit on this? I'm not sure how to create the correct 4x4 matrix from the normal and the origin.

Cheers,
Tijmen

On Tue, Sep 20, 2011 at 3:44 PM, Jothy <[hidden email]> wrote:
You could create a vtkMatrix4x4  and set this matrix to vtkImageReslice->SetResliceAxes(matrix4x4).

Jothy


On Tue, Sep 20, 2011 at 1:32 PM, Tijmen Klein <[hidden email]> wrote:
Thank you for the thip, the combination of vtkImageReslice -> vtkImagemapToColors indeed gives an output that looks what I would expect :) But I am having troubles setting the correct value for setResliceAxesDirectionCosines(), since I only have an origin and normal (no point1 point2).
Right now I just set the origin (SetResliceAxesOrigin()), but I don't set the Direction. One strange thing that I am seeing, is that the plane is rendered outside the original dataset... Would this be because I don't set a proper direction? Or could it have some other reason?

Cheers,
Tijmen


On Tue, Sep 20, 2011 at 1:50 PM, Jothy <[hidden email]> wrote:
I would recommed vtkImageReslice to cut the imageData and to use vtkImagemapToColors with appropriate vtkLookUpTable , then map your data.

Jothy

On Tue, Sep 20, 2011 at 12:40 PM, Tijmen Klein <[hidden email]> wrote:
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers




--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK





--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK



_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Jothy
Take a look at this example

http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx

Jothy

On Tue, Sep 20, 2011 at 2:57 PM, Tijmen Klein <[hidden email]> wrote:
Could you elaborate a bit on this? I'm not sure how to create the correct 4x4 matrix from the normal and the origin.

Cheers,
Tijmen

On Tue, Sep 20, 2011 at 3:44 PM, Jothy <[hidden email]> wrote:
You could create a vtkMatrix4x4  and set this matrix to vtkImageReslice->SetResliceAxes(matrix4x4).

Jothy


On Tue, Sep 20, 2011 at 1:32 PM, Tijmen Klein <[hidden email]> wrote:
Thank you for the thip, the combination of vtkImageReslice -> vtkImagemapToColors indeed gives an output that looks what I would expect :) But I am having troubles setting the correct value for setResliceAxesDirectionCosines(), since I only have an origin and normal (no point1 point2).
Right now I just set the origin (SetResliceAxesOrigin()), but I don't set the Direction. One strange thing that I am seeing, is that the plane is rendered outside the original dataset... Would this be because I don't set a proper direction? Or could it have some other reason?

Cheers,
Tijmen


On Tue, Sep 20, 2011 at 1:50 PM, Jothy <[hidden email]> wrote:
I would recommed vtkImageReslice to cut the imageData and to use vtkImagemapToColors with appropriate vtkLookUpTable , then map your data.

Jothy

On Tue, Sep 20, 2011 at 12:40 PM, Tijmen Klein <[hidden email]> wrote:
I'm currently lost on this one. I have some 3D scalar image data, and want to extract and display a 2D slice/cut from this. The origin and normal of the cutting plane are obtained externally. So I construct a vtkPlane with this information, and then apply this pipeline:

vtkStructuredPointsReader -> vtkCutter (with vtkPlane as the cut function) -> vtkPolyDataMapper -> vtkActor

However, the colors that are shown on the plane don't seem to be accurate. When I create a slice in Paraview of the same data, the colors on the plane look completely different. Is this because Paraview uses a textured plane for this? If so, how can I get this in VTK? I've looked at the vtkImageReslice, but it does not really seem to be handy when you work with an external normal and origin?

Cheers,
Tijmen

_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers




--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK





--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK





--
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK


_______________________________________________
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://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Rafay
In reply to this post by Tijmen Klein
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Oblique slice of 3D image data

Tijmen Klein
Hello Rafay,

I ended up with a different approach, not using the vtkImageReslice, since I wanted to use a vtkPlane as the cutting source. For the solution that I've used, see this post on the mailinglist: http://www.vtk.org/pipermail/vtkusers/2011-September/119089.html

If you want to go the vtkImageReslice -> vtkImagemapToColors way, have a look at the example posted by Jothy (http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx)

Cheers,
Tijmen

On Wed, Sep 28, 2011 at 10:46 PM, Rafay <[hidden email]> wrote:
Hi Tijmen,

I am looking to do the exact same thing. I have 3d data set from a CT and I
want to extract a 2D plane passing through the origin with any direction
cosines I choose and I want to extract the data along this plane. I am using
ImageReslice I was wondering if u could post your code for this part as I
dont understand how you did this

vtkImageReslice -> vtkImagemapToColors

Also do you know how I can incorporate the interpolator into this?

Thanks

--
View this message in context: http://vtk.1045678.n5.nabble.com/Oblique-slice-of-3D-image-data-tp4822198p4850672.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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://www.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

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

Re: Oblique slice of 3D image data

Praz3
Hi, I am having the same need ,i.e, I want to extract a 2D slice out of a 3D
vtkImageData and I am using the vtkPlaneWidget for getting the plane
(vtkPlane) and I want to display this extracted plane. But the same problem
that the
colors shown are not accurate.

As mentioned in this answer that, have found an approach and gave a
link of the post, but unfortunately that url is no more in existence.

Will you please help me to find a solution on this.
If possible I want to have the same color map on the 2D slice that I have
applied to the 3D volume..



Tijmen Klein wrote

> Hello Rafay,
>
> I ended up with a different approach, not using the vtkImageReslice, since
> I
> wanted to use a vtkPlane as the cutting source. For the solution that I've
> used, see this post on the mailinglist:
> http://www.vtk.org/pipermail/vtkusers/2011-September/119089.html
>
> If you want to go the vtkImageReslice -> vtkImagemapToColors way, have a
> look at the example posted by Jothy (
> http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx
> )
>
> Cheers,
> Tijmen
>
> On Wed, Sep 28, 2011 at 10:46 PM, Rafay &lt;

> rafayk_@

> &gt; wrote:
>
>> Hi Tijmen,
>>
>> I am looking to do the exact same thing. I have 3d data set from a CT and
>> I
>> want to extract a 2D plane passing through the origin with any direction
>> cosines I choose and I want to extract the data along this plane. I am
>> using
>> ImageReslice I was wondering if u could post your code for this part as I
>> dont understand how you did this
>>
>> vtkImageReslice -> vtkImagemapToColors
>>
>> Also do you know how I can incorporate the interpolator into this?
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Oblique-slice-of-3D-image-data-tp4822198p4850672.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> 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://www.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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers