<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hello vtkusers,<br>
<br>
Lately, I've been stuck but want to see what I'm trying to do is
possible or at least in the correct direction.&nbsp; Before I was trying to
build my volume from my DICOM data which I succeeded easily by using
vtk.&nbsp; Now lately I wanted to filter my data from noise which I found to
be a little tricky.&nbsp; In the long run I decided I would filter my files
first and store them in vtkAppendPolyData and build my volume from
that.&nbsp; It sounded straight forward in the beginning but now I'm not
sure if this is possible.&nbsp; Is my approach possible or is there another method to filter first and build volume later?&nbsp; Currently I only end up with my last file actually appearing while my other data is not there or lost.<br><br>Thanks in advance,<br>Chris<br><br><hr id="stopSpelling">From: alucard006@msn.com<br>To: mike.jackson@bluequartz.net<br>CC: vtkusers@vtk.org<br>Subject: RE: [vtkusers] Addition Assign AlgorithmOutput? Merge?<br>Date: Fri, 19 Jun 2009 02:01:59 -0700<br><br>



<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>


I'm still stuck on merge filtered data I described below.&nbsp; I start off with <br><br>vtkDICOMImageReader *reader = vtkDICOMImageReader::New();<br>use, SetFIleName();<br><br>This I find allows me to render the skin and filter out extract regions, but I can quite find the correct method to use my new filter data.&nbsp; I've been using this to merge my data.<br><br>//MERGE DATA<br>vtkAppendPolyData *append = vtkAppendPolyData::New();<br>append-&gt;AddInputConnection(connect-&gt;GetOutputPort());<br><br>I use append object to construct my actor object but all I see for a result is my last file filtered.&nbsp; Anybody have experience in this?<br><br><hr id="EC_stopSpelling">From: alucard006@msn.com<br>To: mike.jackson@bluequartz.net<br>CC: vtkusers@vtk.org<br>Subject: RE: [vtkusers] Addition Assign AlgorithmOutput? Merge?<br>Date: Tue, 16 Jun 2009 07:15:55 -0700<br><br>



<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>






<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>





<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>





<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>

Thanks you for the advice about vtkAppendDataset but I seem to only run across vtkAppendCompositeDataLeaves, vtkAppendFilter, vtkAppendPoints, vtkAppendPolyData, and vtkAppendSelection.&nbsp; I tried to use vtkAppendPolyData but when I use 30 files of my data the only result I get back is the last file filtered from my 30, which is just a 2D image.&nbsp; I also get same results with vtkMergeFilter.&nbsp; Here's a piece of code where I'm performing the merge maybe you can see something that I am not doing right.&nbsp; I defined everything here so hopefully you can understand my approach a little better.&nbsp; Any thing else you can or anybody else can suggest in order for me to merge my filtered files into one 3D image?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int index = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int MAX_FILES = 30;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string filename;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; const char *modfilename;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkPolyDataConnectivityFilter *connect = vtkPolyDataConnectivityFilter::New();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkAppendPolyData *append = vtkAppendPolyData::New();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(index &lt; MAX_FILES)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //SKIN RENDER---<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; skinExtractor-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; skinExtractor-&gt;SetValue(0, -400);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //CONNECTIVITY---extract largest region<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect-&gt;SetInputConnection(skinExtractor-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect-&gt;SetExtractionModeToLargestRegion();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect-&gt;Update();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //MERGE DATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append-&gt;AddInputConnection(connect-&gt;GetOutputPort());<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Read Next File<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index++;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(index &lt; MAX_FILES)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; filename = DATADIR + files-&gt;GetValue(index);&nbsp; //files-&gt;GetValue(index) --- returnes the file name from data directory.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; modfilename = filename.c_str();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName(modfilename);&nbsp; //using vtkDICOMImageReader.h<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;Update();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>//Then...on setting up my Actor and window for my 3D image of the new merged data.&nbsp; using the variable "append-&gt;GetOutputPort()" down /the pipeline with all the filtered files.<br><br>Thank you,<br>Chris<br><br>&gt; CC: vtkusers@vtk.org<br>&gt; From: mike.jackson@bluequartz.net<br>&gt; To: alucard006@msn.com<br>&gt; Subject: Re: [vtkusers] Addition Assign AlgorithmOutput? Merge?<br>&gt; Date: Wed, 3 Jun 2009 12:19:31 -0400<br>&gt; <br>&gt; vtkAppendDataset.<br>&gt; <br>&gt; _________________________________________________________<br>&gt; Mike Jackson                  mike.jackson@bluequartz.net<br>&gt; BlueQuartz Software                    www.bluequartz.net<br>&gt; Principal Software Engineer                  Dayton, Ohio<br>&gt; <br>&gt; <br>&gt; <br>&gt; On Jun 3, 2009, at 12:03 PM, Chris N wrote:<br>&gt; <br>&gt; &gt; I have an idea about filtering all my DICOM images of a human head  <br>&gt; &gt; in the format of *.DCM before creating my actor from  <br>&gt; &gt; vtkAlgorithmOutput, one feature I'm not sure about is if or how vtk  <br>&gt; &gt; can perform an addition assign like operation with AlgorithmOutput.   <br>&gt; &gt; Or somehow merge the two different datas into one AlgorithmOutput.   <br>&gt; &gt; Anyway, here's my idea of what I'm trying to do.  Using VTK, C++,  <br>&gt; &gt; and I am new to VTK.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; LOOP(imagenumber &lt; maximagenumber)<br>&gt; &gt; {<br>&gt; &gt;     //Reads in one 2D DICOM image<br>&gt; &gt;     vtkDICOMImageReader::SetFileName( "DICOMdata" imagenumber++);<br>&gt; &gt;<br>&gt; &gt;     //Set value for skin data only from my DICOM data<br>&gt; &gt;     vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>&gt; &gt;     skinExtractor-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>&gt; &gt;     skinExtractor-&gt;SetValue(0, -400);<br>&gt; &gt;<br>&gt; &gt;     //Extract the largest Region<br>&gt; &gt;     vtkPolyDataConnectivityFilter *connect =  <br>&gt; &gt; vtkPolyDataConnectivityFilter::New();<br>&gt; &gt;     connect-&gt;SetInputConnection(skinExtractor-&gt;GetOutputPort());<br>&gt; &gt;     connect-&gt;SetExtractionModeToLargestRegion();<br>&gt; &gt;<br>&gt; &gt;     //Here is where I would like to build a final algorithmoutput  <br>&gt; &gt; from the accumulation<br>&gt; &gt;     //of each image after its been filtered.<br>&gt; &gt;     //Would like the following line to perform like an Addition  <br>&gt; &gt; assign operator but is<br>&gt; &gt;     //there a function or something to create this effect?<br>&gt; &gt;<br>&gt; &gt;     (*FinalAlgorithmOutput) += (*CurrentImageFilterAlgorithmOutput);<br>&gt; &gt;<br>&gt; &gt;     //REPEAT<br>&gt; &gt; }<br>&gt; &gt;<br>&gt; &gt; Now once out of the loop, i create my actors and windows then I  <br>&gt; &gt; build my DICOM code.  Once data is displayed it should show the  <br>&gt; &gt; filtered 3d head.  Any advice, suggestions, ideas about this is  <br>&gt; &gt; welcomed, thanks!<br>&gt; &gt;<br>&gt; &gt; Lauren found her dream laptop. Find the PC that’s right for you.  <br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; <br><br><hr>Microsoft brings you a new way to search the web. <a href="http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009">Try  Bing™ now</a><br><hr>Bing™  brings you maps, menus, and reviews organized in one place. <a href="http://www.bing.com/search?q=restaurants&amp;form=MLOGEN&amp;publ=WLHMTAG&amp;crea=TEXT_MLOGEN_Core_tagline_local_1x1">Try it now.</a><br /><hr />Lauren found her dream laptop.  <a href='http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290' target='_new'>Find the PC that’s right for you.</a></body>
</html>