[vtkusers] Want vtk dataset from my DICOM data
Eric E. Monson
emonson at cs.duke.edu
Wed May 20 09:22:58 EDT 2009
Hey Chris,
Make sure you "reply to all" so that the whole list can contribute
answers.
First, this probably isn't causing any of your problems, but you may
want to switch to the vtkPolyDataConnectivityFilter -- since the
contour filter will output polygonal mesh, this filter may be
optimized a bit more for that specific data type.
Second, what shows up in your vtkRenderWindow? Do you see the whole
contour as if you didn't even use the connectivity filter?
Try setting the connectivity filter to
connect->SetExtractionModeToAllRegions();
connect->SetColorRegions(1);
and see if you see a lot of differently colored regions. Or, try
connect->SetExtractionModeToSpecifiedRegions();
connect->AddSpecifiedRegion(0);
connect->AddSpecifiedRegion(1);
connect->SetColorRegions(1);
and look in the render window to see if the correct subsets are being
extracted.
I'm sure there are a lot of people out there using this filter, so I
hope someone else will chime in that knows more than me about this
specific one! :)
-Eric
------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group
On May 20, 2009, at 3:59 AM, Chris N wrote:
> This is my specific problem currently. I working with DICOM data
> using VTK and C++. My DICOM data is a human head and I'm trying to
> make my data only view skin. The problem I running into now is that
> I want to eliminate the internals such as the canals for ears and
> throat when I only render skin. Along with the depth I have two
> plates rendered on the side of my sample head data.
>
> Recently I found vtkConnectivityFilter has the function to extract
> the largest region and ignoring everything else. When I try to use
> this class and I view the number of connected regions extracted I
> only get the number 0. My data still remains the same and unaltered
> as though I never used connectivityfilter. Below I just added the
> only code I wrote for the vtkConnectivityFilter, maybe I missed
> something there? Any suggestions?
>
> //vtkDICOMImageReader - using set directory name
>
> //vtkContourFilter - (skinExtractor) set value for skin
>
> //CONNECTIVITY
> vtkConnectivityFilter *connect = vtkConnectivityFilter::New();
> connect->SetInputConnection(skinExtractor->GetOutputPort());
> connect->SetExtractionModeToLargestRegion();
> //NUMBER OF REGIONS
> int numregion = connect->GetNumberOfExtractedRegions();
> std::cout<< "Number of Connected Regions: " << numregion <<endl;
>
> //Window, Outline, Actor, etc.
>
>
>
> From: emonson at cs.duke.edu
> To: alucard006 at msn.com
> Date: Tue, 19 May 2009 12:37:58 -0400
> CC: vtkusers at vtk.org
> Subject: Re: [vtkusers] Want vtk dataset from my DICOM data
>
> Hey Chris,
>
> The output from the vtkDICOMImageReader is an instance of
> vtkImageData, so as the pipeline continues that is what is
> processed. In python, you can get this data by calling
> reader.GetOutput() or reader.GetOutputDataObject(0), and similar in C
> ++.
>
> If you really want to save that data in another file, one option
> would be to use the vtkXMLImageDataWriter to write to a .vti file.
> Otherwise, just use the reader and feed its output port into the
> input port of the Contour filter as you've seen recently.
>
> If this isn't clear, just let us know more specifically what
> problems you're having.
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> On May 19, 2009, at 4:44 AM, Chris N wrote:
>
> NEW USER but I've been reading similiar problems with using
> vtkPolyDataConnectivityFilter with DICOM data. One person did post
> a solution but using the standard vtk dataset from vtkdata. Is it
> possible to convert my DICOM data into vtk data set so once that is
> done I can use my vtkPolyDataConnectivityFilter on that data set.
> Or does DICOMreader do convert into vtk dataset already? If that is
> the case how can I retieve that data? Ultimately, I'm trying to
> filter out data with vtkPolyDataConnectivityFilter and using my
> DICOM data. any help is appreciated, thanks!
>
>
> Hotmail® has a new way to see what's up with your friends. Check it
> out. _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects athttp://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
>
>
> Windows Live™: Keep your life in sync. Check it out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090520/5439f08e/attachment.htm>
More information about the vtkusers
mailing list