[Paraview] [ParaView] How to add thickness to each slice when generating a 3D model
Moreland, Kenneth
kmorel at sandia.gov
Wed May 11 15:00:39 EDT 2016
Without seeing the actual vtk file you are using, it is hard to give you the exact steps. I am assuming that when you say the masks are “stacked together” that they are available as field variables (for example, you can color the surface by them). Furthermore, I assume by “make visible” the masks, you mean removed the masked out cells so that you can see through the holes in the data.
To do that, after you load your vtk file, add the Threshold filter. Set the “Scalars” property to the mask variable and then set the range to the mask value you want to pass.
-Ken
From: Chathuri Gunasekera <cgunases at gmail.com>
Date: Wednesday, May 11, 2016 at 11:34 AM
To: Kenneth Moreland <kmorel at sandia.gov>, ParaView <paraview at paraview.org>
Subject: [EXTERNAL] Re: [Paraview] [ParaView] How to add thickness to each slice when generating a 3D model
Hi,
Thanks alot for your response, Ken.
Herewith,pls see the attachment: how the 3 small masks are looked like. So the large mask(it's not seen here) encompass all three masks. All 4 masks are saved in different folders and all of them have been called in, stacked together and converted to vtk to call into Paraview.
So how should i move forward in order to make visible the small 3 masks in the model?
Let me know anyone of your thoughts about it.
--
Warm regards,
Chathuri Gunasekera.
On Wed, May 11, 2016 at 7:12 PM, Moreland, Kenneth <kmorel at sandia.gov<mailto:kmorel at sandia.gov>> wrote:
Chathuri Gunasekera,
Are your patches available as fields in the data? If so, you should be able to use the Threshold filter with the patches to remove the holes.
-Ken
From: Chathuri Gunasekera <cgunases at gmail.com<mailto:cgunases at gmail.com>>
Date: Tuesday, May 10, 2016 at 8:31 PM
To: Kenneth Moreland <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
Cc: "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] Re: [Paraview] [ParaView] How to add thickness to each slice when generating a 3D model
Hi to all,
@ Ken, thank you so much for your response. Really admire it.
1. Yes, i am 100% certain that all the masks are called in.
But let me be more into detail.
Basically, i have: 1 big mask and 3 patches (which are also saved as masks). Sorry Ken, i think i should have use patch instead of hole [ this patch eventually represent some special features{but these features eventually build up as tubes when it comes to a 3D model.} in a human organ as i am trying to model a human organ itself ]. ANyhow, i am sorry if i make you confuse.
You're right Ken, most of the stuff is done in MatLab but all the work looks error-free(because it works fine atleast in MatLab). But i am skeptic of one thing. Should i have to have a transparent big mask in order to see the 3 patches inside the big mask? Is that why , i don't see the patches ? Kindly guide me.
2. I will try that out too.
Anyhow, thank you so much for your detailed response Ken. That is a great help.
--
Warm regards,
Chathuri Gunasekera.
On Wed, May 11, 2016 at 12:08 AM, Moreland, Kenneth <kmorel at sandia.gov<mailto:kmorel at sandia.gov>> wrote:
Chathuri Gunasekera,
(Responding back to ParaView list to allow others to see and comment.)
1. I’m not sure why you are not see the 3 holes you expect in your mask. It looks like most of your process is building the data in MATLAB. Perhaps something is going wrong there. ParaView must be recognizing the mask since the region outside of the external boundary is removed. Are you sure your three holds are represented in the mask?
2. It sounds like you are finding the mask boundary in a slice. A slice is by definition contained in a 2D plane. You can restore the 2mm thickness manually by running the Extract Surface filter and then the Linear Extrusion filter.
-Ken
From: Chathuri Gunasekera <cgunases at gmail.com<mailto:cgunases at gmail.com>>
Date: Tuesday, May 10, 2016 at 12:03 PM
To: Kenneth Moreland <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
Subject: [EXTERNAL] Re: [Paraview] [ParaView] How to add thickness to each slice when generating a 3D model
Hi Ken,
Your detailed description is very much appreciated. Thank you so much.
Kindly note that following is what i have done in MatLab :
a. Segmented images as Masks (just x,y cordinates)
b. Saved as a .mat file
c. Then append z coordinate( z coordinate is the slice thickness which, each slice has a thickness of 2mm) to the above said mask. Hence, now the image is 3D (saved as .mat file)
d. Convert the 3D image into real world coordinates . So x,y,z all are in mm now. (saved as .mat file)
e. Since i have about 8 sets and about 50 images per set. Then find the smallest dimension for a particular set.
f. Crop the image (saved as .mat file)
g. Stack the image (saved as .mat file)
h. Finally convert the .mat file to .vtk file
i. Then open the .vtk files in Paraview
Let me send you 2 outputs which i have obtained so far
1. segmented masked images. I prefer this method because this image looks close to my expectation(i expect a 3D model). Also i have 3 more masks which represent 3 more features inside the big mask (meaning i expect 3 holes inside the big image). But i simply cannot see the 3 holes inside this big mask. What mistake i am doing here? Why can't i see the 3 holes inside the big mask.
2. segmented masked --> converted RGB image to binary and then find the boundary of the mask. So the reason for why i asked the thickness is that for this output i can't see the 2mm thickness .
Kindly note that in order to obtain above output i have used couple of masks(slices) and stacked them together.
Your assistance is really appreciated here as i was struggling to get a proper 3D model for sometime now and all my efforts are not succeeded yet.
Thank you.
--
Warm regards,
Chathuri Gunasekera.
On Tue, May 10, 2016 at 9:50 PM, Moreland, Kenneth <kmorel at sandia.gov<mailto:kmorel at sandia.gov>> wrote:
I think we need more information before we can answer your questions.
Your first question was how to “add thickness” to image slices. If you have image slices, you usually want to load them in as a 3D stack and treat them like a volume. The spacing between the slices is typically specified by the data file itself or by an option in the reader (of which there are almost 100 different types in ParaView). So how you do that depends on your data format.
You simply said that your data comes from MATLAB. That’s not very specific, since it is possible to output lots of different types of files from MATLAB. If you are not doing it yet, you might consider this MATLAB module that writes out VTK files (which ParaView handles very well): http://www.mathworks.com/matlabcentral/fileexchange/47814-export-3d-data-to-paraview-in-vtk-legacy-file-format . I haven’t used it myself (I use MATLAB very infrequently), but it looks pretty full featured. You might want to check that out.
You also mentioned that the image segmentation is represented by masks. The easiest way to deal with that is probably to use the Threshold filter to remove all cells that are masked out.
-Ken
From: ParaView <paraview-bounces at paraview.org<mailto:paraview-bounces at paraview.org>> on behalf of Chathuri Gunasekera <cgunases at gmail.com<mailto:cgunases at gmail.com>>
Date: Tuesday, May 10, 2016 at 4:49 AM
To: ParaView <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] Re: [Paraview] [ParaView] How to add thickness to each slice when generating a 3D model
Also,i need to mention that segmented images are saved as Masks.
Kindly tell me, when using Paraview software should i have to use the boundary or the mask of the segmented image for the purpose of building a 3D model. (kindly correct me, if i am wrong as i am new to Paraview)
Hope to hear from you soon.
Thank you.
On Tue, May 10, 2016 at 2:53 PM, Chathuri Gunasekera <cgunases at gmail.com<mailto:cgunases at gmail.com>> wrote:
Hello everyone,
My goal is to generate a 3D model of human organ.
Suppose i have segmented images in each set(each slice is saved using MatLab software).
So i want to know what are the options which paraview have in order to add the thickness to each slice.
Your feedback is appreciated.
--
Warm regards,
Chathuri Gunasekera.
--
Warm regards,
Chathuri Gunasekera.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160511/2b9e9ff9/attachment.html>
More information about the ParaView
mailing list