[vtkusers] Combining volumes

Veerapuram Varadhan v.varadhan at gmail.com
Tue Aug 31 11:20:27 EDT 2004


You can use vtkImageAppend.

vtkVolume16Reader* v16 =  vtkVolume16Reader::New();
    v16->SetDataDimensions( 64, 64);
    v16->SetDataByteOrderToLittleEndian();
    v16->SetImageRange( 1, 93);
    v16->SetDataSpacing( 3.2, 3.2, 1.5);
    v16->SetFilePrefix( fname );
    v16->SetDataMask( 0x7fff);
    v16->Update();

vtkVolume16Reader* v16_1 =  vtkVolume16Reader::New();
    v16_1->SetDataDimensions( 64, 64);
    v16_1->SetDataByteOrderToLittleEndian();
    v16_1->SetImageRange( 1, 93);
    v16_1->SetDataSpacing( 3.2, 3.2, 1.5);
    v16_1->SetFilePrefix( fname_1 );
    v16_1->SetDataMask( 0x7fff);
    v16_1->Update();
vtkImageAppend* imageAppend = vtkImageAppend::New();
imageAppend->AddInput (v16->GetOutput());
imageAppend->AddInput (v16_1->GetOutput());
imageAppend->SetAppendAxis (0);
imageAppend->Update();

vtkImageData* pImageData = imageAppend->GetOutput();

pImageData should have the appended volume.  

P.S:- I am not sure whether this will work or not :), as I don't have
vtk in the current box.  Kindly let me know the correct way. :)

V. Varadhan.

On Tue, 31 Aug 2004 08:22:51 -0400, Isaac Gerg <isaacgerg at psu.edu> wrote:
> I want to take the two halfs and form a whole volume. Not a volume with
> the right half and then the left half appended to it.
> 
> Isaac
> 
> 
> 
> -----Original Message-----
> From: Veerapuram Varadhan [mailto:v.varadhan at gmail.com]
> Sent: Tuesday, August 31, 2004 4:38 AM
> To: Isaac Gerg
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Combining volumes
> 
> Hi,
> 
> What exactly do you mean by "creating a volume ...... both
> simultaneous"?
> 
> Say you have 20 images with the following pattern:
> left0.bmp ..... left9.bmp and
> right0.bmp ..... right9.bmp.
> 
> One possible way is:
> rename all right0.bmp through right9.bmp as left10.bmp and so on and if
> you read these 20 images, you can get all of them in a single volume.
> However, the volume will not look good and  of least use.
> 
> Kindly correct me if my understanding of your question is wrong.
> 
> Regards,
> V. Varadhan.
> 
> On Mon, 30 Aug 2004 15:38:49 -0400, Isaac Gerg <isaacgerg at psu.edu>
> wrote:
> > Hi,
> >
> > I have 20 images of an object. 10 of them are a scan of the right
> > side, and the other 10 a scan of the left side.  I want to create a
> > volume from all 20 images.  Currently I can only create a volume for
> > the left side or for the right, but not both simultanusous? How would
> > I go about doing this?
> >
> > Any help greatly appreciated.
> >
> > Regards,
> > Isaac
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> 
>



More information about the vtkusers mailing list