No subject


Fri Jan 14 08:05:08 EST 2011


This means that when you use ImageAdaptors, you must make sure
that the filter receiving the Adaptor is based on the use of the
"*WithIndex" iterators.

<http://www.itk.org/pipermail/insight-users/2005-April/012553.html>

On Mon, Feb 21, 2011 at 1:36 PM, Hsieh <M.Hsieh at student.tudelft.nl> wrote:

> Hi,
>
>
>
> Now I send it to Insight-Users mailing list.
>
> My purpose is to extract elements from the tensor image to analyze and
> register the tensor channels. With your help now I can do so with vector
> image adaptor, which extracts one of the element of the vector. However, in
> the example of ImageAdaptor3.cxx, the adaptor itself cannot directly be fed
> into the writer to create a scalar image. It is shown that a filter, such as
> rescaling the intensity, has to be done and therefore the
> rescaler->GetOutput() can be set as the input image for writer. Is there a
> way not to modify the intensity of the image? Is there an identity filter or
> something like that?
>
>
>
> Best regards,
>
> Michael
>
>
>
>
>
>
>
> This is more of a question for the Insight-Users mailing list.
>
>
>
> That being said, you don't show your work, so I can't say exactly what
> you're doing wrong.
>
>
>
> I wrote the NIfTI image reader, and as I remember there's some strange
> things that go on with respect to  Images with dimension > 3.
>
>
>
> If I recall correctly, in a NIfTI image dimensions of [ 128 128 64 1 6 ]
> would not correspond to an 5D scalar image at all.  It would be a 3D image
> where each voxel is a 6-element vector.  The 4th dimension is ALWAYS
> interpreted as a time dimension, and the sixth and subsequent dimensions are
> interpreted according to what the image modality actually was.  Most often,
> and what's implemented in the reader, is to interpret it as an Image of
> Vector voxels. So NiftiImageIO reads in 6 3D volumes, and then constructs
> vector pixels by pulling one pixel from each of the volumes.
>
>
>
> In other words if you used
>
>
>
> typedef itk::Image< itk::Vector<float, 6>, 3 > ImageType;
>
> typedef itk::ImageFileReader<Imagetype> ImageReaderType;
>
>
>
> You would get all the data.  If you use
>
>
>
> typedef itk::Image<float, 3> ImageType;
>
> typedef itk::ImageFileReader<ImageType> ImageReaderType;
>
>
>
> the ImageFileReader will think that it's a vector image and try to convert
> the vector voxels to a scalar voxel, probably by taking the first value of
> each voxel's vector.  It will then report the image size as you reported.
>
>
>
> *From: *Hsieh <M.Hsieh at student.tudelft.nl>
> *Date: *Fri, 18 Feb 2011 16:35:07 +0100
> *To: *ITK <insight-developers at itk.org>
> *Subject: *[Insight-developers] Problem in reading 5D nifti image
>
>
>
> Hi,
>
>
>
> I am trying to read a diffusion tensor image in nifti(.nii) format, which
> has dimension of [128 128 64 1 6]. However, the image I got after read by
> the itkImageFileReader.h had dimension only [128 128 64 1 1]. The last two
> dimension are suppressed by the reader. When I looked into the class (.h)
> and the .txx file, I found out that the numberOfDimensionsIO, which is 3, is
> smaller than TOutputImage::ImageDimension, which is set manually to 5, so
> that the 4th and the 5th dimension are set to 1 later. Why does that
> happen? numberOfDimensionsIO should be 5 in this case.
>
>
>
> Best regards,
>
> Meng-Kang Hsieh (Michael)
>
> OpSciTech, Erasmus Mundus
>
> Delft University of Technology
>
>
>
>
>
> Best regards,
>
> Meng-Kang Hsieh (Michael)
>
> OpSciTech, Erasmus Mundus
>
> Delft University of Technology
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>

--20cf307cfef4675a0a049ccf8f17
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Section 12.5 of the ITK software guide:</div><div><div>12.5 Adaptors a=
nd Writers</div><div>Image adaptors will not behave correctly when connecte=
d directly to a writer. The reason is</div><div>that writers tend to get di=
rect access to the image buffer from their input, since image adaptors</div=
>
<div>do not have a real buffer their behavior in this circumstances is inco=
rrect. You should avoid</div><div>instantiating the ImageFileWriter or the =
ImageSeriesWriter over an image adaptor type.</div></div><div><br></div>


More information about the Insight-users mailing list