[vtkusers] READING RAW FILE

nikhil singhania niksinghania at gmail.com
Thu Feb 25 01:09:07 EST 2010


Thanks a lot Mr. Gomez,
considering your approach, I have another question in mind, We have
done all configuration for vtk , now at the mid point using itk, which
we have not used till now, I don't know much of itk, since i used vtk
for most purpose, there must be similar object in vtk too. The
filereading i did for a sample data "HeadMRVolume.raw", where my input
was just the raw file and not the .mhd file. Anyway my question is
that can we do it in vtk only.
And sir by any chance do you know how is data stored in the raw file
so that we can write a code to read it, i mean like x,y cordinated
stored for one slice then next slice like that or what..? This
question has been bugging my mind for so long.

On 24/02/2010, Gomez, Alberto <alberto.gomez at kcl.ac.uk> wrote:
> Hi,
>
> my advice is that if you do not have the mhd file, but you have all the
> information, then generate it yourself. Mhd files are text files that
> have this shape (for example):
>
> ObjectType = Image
> NDims = 3
> BinaryData = True
> BinaryDataByteOrderMSB = False
> CompressedData = False
> TransformMatrix = 1 0 0 0 1 0 0 0 1
> Offset = 0.0 0.0 0.0
> CenterOfRotation = 0 0 0
> AnatomicalOrientation = RAI
> ElementSpacing = 1 1 1
> DimSize = 200 180 160
> ElementNumberOfChannels = 4
> ElementType = MET_FLOAT
> ElementDataFile = filename.raw
>
> Then, you can open it easily. I read it with ITK (itkFileReader supports
> this format), store it into an itkImage object and I have full acces to
> voxel data. Then you can do downsampling and finally  you can convert it
> to VTK and visualise it, I believe you want to do some processing on it
> before visualisation, so opening it with ITK looks a reasonable approach
> to me. You can also open it with a viewer supporting mhd format (like
> ImageJ + 3D IO plugin), but You will quickly run out of memory.
>
>
>
>
> nikhil singhania wrote:
>> I agree with you there is .mhd file containing all that, but working
>> with larger data of human male 3.5 gb, i do not have the .mhd file but
>> i have all the information but still , since we don't know how is data
>> stored in raw file, i am not able to extract the desired data from raw
>> file. I am not visualizing directly but i have to visualize after some
>> sampling because for such a large data it's not possible..
>>
>> On 24/02/2010, Gomez, Alberto <alberto.gomez at kcl.ac.uk> wrote:
>>
>>> A .raw typically comes together with another file, for example a .mhd
>>> file. This is the file you have to open. It contains information like
>>> the spacing, the size, etc, and a link to the .raw file. I am not sure
>>> if this is always this way though...
>>>
>>> good luck
>>>
>>> nikhil singhania wrote:
>>>
>>>> hi all,
>>>> We are trying to read a .raw file. It's a single 3d file. We are
>>>> unaware of its structure so we are not able to apply any aglorithm. We
>>>> want to get the voxel information and output that to a text file.
>>>> Please help us if there is any such information.
>>>>
>>>>
>>> --
>>>
>>> Alberto Gómez
>>>
>>> /Division of Imaging Sciences
>>> The Rayne Institute
>>> 4th Floor, Lambeth Wing
>>> St Thomas' Hospital
>>> London SE1 7EH /
>>>
>>> phone: +44 (0) 20 718 88364
>>> email: alberto.gomez at kcl.ac.uk <mailto:alberto.gomez at kcl.ac.uk>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
>
> Alberto Gómez
>
> /Division of Imaging Sciences
> The Rayne Institute
> 4th Floor, Lambeth Wing
> St Thomas' Hospital
> London SE1 7EH /
>
> phone: +44 (0) 20 718 88364
> email: alberto.gomez at kcl.ac.uk <mailto:alberto.gomez at kcl.ac.uk>
>
>


-- 
Nikhil Kumar
rit2007033
b.tech IT 6th sem
IIIT Allahabad
contact at 9793905858
email: rit2007033 at iiita.ac.in
          niksinghania at gmail.com
http://profile.iiita.ac.in/RIT2007033/



More information about the vtkusers mailing list