[vtkusers] use of vtkMetaImageReader
Kevin H. Hobbs
hobbsk at ohiou.edu
Wed Sep 27 10:33:29 EDT 2006
On Wed, 2006-09-27 at 05:22 -0700, samo wrote:
> Well, what I would like to know is how I can use vtkMetaImageReader. I have
> a file with .mdh (my header) and a .raw file (the body). What I tried now
> is:
>
> m_MetaVolumeReader->GetOutput()->SetOrigin(0.0, 0.0, 0.0);
> m_MetaVolumeReader->SetFilePrefix(prefix);
> m_MetaVolumeReader->SetFilePattern("%s%03d.dcm.raw");
> m_MetaVolumeReader->SetDataExtent(0,511,0,511,0,102);
> m_MetaVolumeReader->SetDataSpacing(1.0,1.0,2.0);
> m_MetaVolumeReader->SetDataByteOrderToLittleEndian();
> m_volumeData = m_MetaVolumeReader->GetOutput();
> m_MetaVolumeReader->Update();
Wow, you don't need any of that. The whole point of the header is that
ALL meta information is in the header. You should only need :
vtkMetaImageReader * reader = vtkMetaImageReader::New();
reader->SetFileName( "whaterver.mhd" );
You don't even need to update the reader or make a pointer to it's
output just :
next_filter->SetInputConnection( reader->GetOutputPort() );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060927/e3ea97c4/attachment.pgp>
More information about the vtkusers
mailing list