[vtkusers] Addition Assign AlgorithmOutput? Merge?

Chris N alucard006 at msn.com
Fri Jun 19 05:01:59 EDT 2009


I'm still stuck on merge filtered data I described below.  I start off with 

vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
use, SetFIleName();

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.  I've been using this to merge my data.

//MERGE DATA
vtkAppendPolyData *append = vtkAppendPolyData::New();
append->AddInputConnection(connect->GetOutputPort());

I use append object to construct my actor object but all I see for a result is my last file filtered.  Anybody have experience in this?

From: alucard006 at msn.com
To: mike.jackson at bluequartz.net
CC: vtkusers at vtk.org
Subject: RE: [vtkusers] Addition Assign AlgorithmOutput? Merge?
Date: Tue, 16 Jun 2009 07:15:55 -0700


























Thanks you for the advice about vtkAppendDataset but I seem to only run across vtkAppendCompositeDataLeaves, vtkAppendFilter, vtkAppendPoints, vtkAppendPolyData, and vtkAppendSelection.  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.  I also get same results with vtkMergeFilter.  Here's a piece of code where I'm performing the merge maybe you can see something that I am not doing right.  I defined everything here so hopefully you can understand my approach a little better.  Any thing else you can or anybody else can suggest in order for me to merge my filtered files into one 3D image?

        int index = 0;
        int MAX_FILES = 30;
        string filename;
        const char *modfilename;

        vtkContourFilter *skinExtractor = vtkContourFilter::New();
        vtkPolyDataConnectivityFilter *connect = vtkPolyDataConnectivityFilter::New();
        vtkAppendPolyData *append = vtkAppendPolyData::New();

        while(index < MAX_FILES)
        {
                //SKIN RENDER---
                skinExtractor->SetInputConnection(reader->GetOutputPort());
                skinExtractor->SetValue(0, -400);

                //CONNECTIVITY---extract largest region
                connect->SetInputConnection(skinExtractor->GetOutputPort());
                connect->SetExtractionModeToLargestRegion();
                connect->Update();

                //MERGE DATA
                append->AddInputConnection(connect->GetOutputPort());

                //Read Next File
                index++;
                if(index < MAX_FILES)
                {
                    filename = DATADIR + files->GetValue(index);  //files->GetValue(index) --- returnes the file name from data directory.
                    modfilename = filename.c_str();
                }

                reader->SetFileName(modfilename);  //using vtkDICOMImageReader.h
                reader->Update();
        }

//Then...on setting up my Actor and window for my 3D image of the new merged data.  using the variable "append->GetOutputPort()" down /the pipeline with all the filtered files.

Thank you,
Chris

> CC: vtkusers at vtk.org
> From: mike.jackson at bluequartz.net
> To: alucard006 at msn.com
> Subject: Re: [vtkusers] Addition Assign AlgorithmOutput? Merge?
> Date: Wed, 3 Jun 2009 12:19:31 -0400
> 
> vtkAppendDataset.
> 
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
> 
> 
> 
> On Jun 3, 2009, at 12:03 PM, Chris N wrote:
> 
> > I have an idea about filtering all my DICOM images of a human head  
> > in the format of *.DCM before creating my actor from  
> > vtkAlgorithmOutput, one feature I'm not sure about is if or how vtk  
> > can perform an addition assign like operation with AlgorithmOutput.   
> > Or somehow merge the two different datas into one AlgorithmOutput.   
> > Anyway, here's my idea of what I'm trying to do.  Using VTK, C++,  
> > and I am new to VTK.
> >
> >
> > LOOP(imagenumber < maximagenumber)
> > {
> >     //Reads in one 2D DICOM image
> >     vtkDICOMImageReader::SetFileName( "DICOMdata" imagenumber++);
> >
> >     //Set value for skin data only from my DICOM data
> >     vtkContourFilter *skinExtractor = vtkContourFilter::New();
> >     skinExtractor->SetInputConnection(reader->GetOutputPort());
> >     skinExtractor->SetValue(0, -400);
> >
> >     //Extract the largest Region
> >     vtkPolyDataConnectivityFilter *connect =  
> > vtkPolyDataConnectivityFilter::New();
> >     connect->SetInputConnection(skinExtractor->GetOutputPort());
> >     connect->SetExtractionModeToLargestRegion();
> >
> >     //Here is where I would like to build a final algorithmoutput  
> > from the accumulation
> >     //of each image after its been filtered.
> >     //Would like the following line to perform like an Addition  
> > assign operator but is
> >     //there a function or something to create this effect?
> >
> >     (*FinalAlgorithmOutput) += (*CurrentImageFilterAlgorithmOutput);
> >
> >     //REPEAT
> > }
> >
> > Now once out of the loop, i create my actors and windows then I  
> > build my DICOM code.  Once data is displayed it should show the  
> > filtered 3d head.  Any advice, suggestions, ideas about this is  
> > welcomed, thanks!
> >
> > Lauren found her dream laptop. Find the PC that’s right for you.  
> > _______________________________________________
> > 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
> 

Microsoft brings you a new way to search the web. Try  Bing™ now
_________________________________________________________________
Bing™  brings you maps, menus, and reviews organized in one place.   Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090619/33e54ce9/attachment.htm>


More information about the vtkusers mailing list