<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Chris,<div><br></div><div>Make sure you "reply to all" so that the whole list can contribute answers.</div><div><br></div><div>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.</div><div><br></div><div>Second, what shows up in your vtkRenderWindow? Do you see the whole contour as if you didn't even use the connectivity filter?</div><div><br></div><div>Try setting the connectivity filter to </div><div><div>connect->SetExtractionModeToAllRegions();</div><div>connect->SetColorRegions(1);</div><div><br></div><div>and see if you see a lot of differently colored regions. Or, try</div></div><div><br></div><div>connect->SetExtractionModeToSpecifiedRegions();</div><div>connect->AddSpecifiedRegion(0);</div><div>connect->AddSpecifiedRegion(1);</div><div>connect->SetColorRegions(1);</div><div><br></div><div><div><div>and look in the render window to see if the correct subsets are being extracted.</div><div><br></div><div>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! :)</div><div><br></div><div>-Eric</div><div><br></div><div><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br></div><div><br></div></div><div><br></div><div>On May 20, 2009, at 3:59 AM, Chris N wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">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.<br><br>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?<br><br> //vtkDICOMImageReader - using set directory name<br><br> //vtkContourFilter - (skinExtractor) set value for skin<br> <br> //CONNECTIVITY<br> vtkConnectivityFilter *connect = vtkConnectivityFilter::New();<br> connect->SetInputConnection(skinExtractor->GetOutputPort());<br> connect->SetExtractionModeToLargestRegion();<br> //NUMBER OF REGIONS<br> int numregion = connect->GetNumberOfExtractedRegions();<br> std::cout<< "Number of Connected Regions: " << numregion <<endl;<br><br> //Window, Outline, Actor, etc.<br><br><br><br><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:alucard006@msn.com">alucard006@msn.com</a><br>Date: Tue, 19 May 2009 12:37:58 -0400<br>CC:<span class="Apple-converted-space"> </span><a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>Subject: Re: [vtkusers] Want vtk dataset from my DICOM data<br><br>Hey Chris,<div><br></div><div>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++.</div><div><br></div><div>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.</div><div><br></div><div>If this isn't clear, just let us know more specifically what problems you're having.</div><div>-Eric</div><div><br></div><div><div><span class="EC_Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; "><div><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br></div></div></span></div><br><div><div>On May 19, 2009, at 4:44 AM, Chris N wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; "><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana; ">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!<br><br><br><hr>Hotmail® has a new way to see what's up with your friends.<span class="EC_Apple-converted-space"> </span><a href="http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009">Check it out.</a><span class="EC_Apple-converted-space"> </span>_______________________________________________<br>Powered by<span class="EC_Apple-converted-space"> </span><a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></span></blockquote></div><br></div><br><hr>Windows Live™: Keep your life in sync.<span class="Apple-converted-space"> </span><a href="http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009" target="_new">Check it out.</a></div></span></blockquote></div><br></div></body></html>