[Insight-developers] world coordinates and slice images - nifti problem?

Richard Beare richard.beare at gmail.com
Sun Mar 1 23:23:56 EST 2009


Hi everyone,

I've tracked down the problem - the issues was the fslsplit tool I was
using to extract the slice from the time series was dropping the 3rd
dimension, so it was in fact a 2d nifti file, even though it was being
inserted into the time series as 3D.

Are there any classes for extracting samples from time series or
constructing time series - it looks as though I'm going to need to
write something to deal with time series of slices.

On Sat, Feb 28, 2009 at 9:24 AM, Richard Beare <richard.beare at gmail.com> wrote:
> Hi,
>
> I'll have to wait until next week to post images (at work).
>
> The situation is this. I have two images, each of which is a time
> series with a single physical slice.
>
> I convert load each dicom from the timeseries into a itk::Image<short,
> 3> and save as a nifti file. So I certainly hoped that this is a 3d
> nifti file with one slice. Tools like fslinfo certainly report a z
> dimension of 1 and 3 dimensions.
>
> I was certainly aiming to get a 3d image on disk with one slice. I
> hope that is what I achieved.
>
> I'm after full 3D information so I can display a collection of slices
> like this in their correct relative orientation.
>
> Should this be feasible?
>
> On Fri, Feb 27, 2009 at 11:28 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>>
>> Hi Richard,
>>
>>
>> I'm having trouble understanding your description of the problem.
>>
>>
>> You said:
>>> My problem is that even though I declare the image as 3D, it only has
>>> 1 slice, and the PhysicalPoints produced by the transformation all
>>> have a z value of 0. If I concatenate two slices together the results
>>> are as I expect. On the surface it looks like it might be a nifti
>>> loading issue
>>
>>
>>
>> Your message is not telling us what the actual image in disk is.
>>
>> For example:
>>
>>   a) Is the image on file a 3D image ?
>>   b) If so, does it really have more than 1 slice ?
>>
>> or
>>
>>   c) Are you tring to read a 2D nifti image file
>>      into an itk::Image< Pixel, 3 > type ?
>>
>>
>> If the situation is (c), then the behavior looks quite normal.
>>
>> but
>>
>> if the situation is that your have a 3D image with more than
>> one slice on file, and when you read it into an ITK 3D image,
>> you only get one slice, then that's clearly a bug.
>>
>>
>> Could you please clarify ?
>>
>> and...
>>
>> Please post to the list:
>>
>>  A) The offending Nifti image, and
>>  B) The (minima) source code that illustrates the problem
>>
>>
>> Thanks,
>>
>>
>>    Luis
>>
>>
>> ---------------------
>> Richard Beare wrote:
>>>
>>> Hi,
>>> I'm not sure if this counts as a bug, and I haven't tracked down the
>>> root of the issue yet, but thought I'd flag it immediately.
>>>
>>> This relates to the same data as my past few posts - single slice MR
>>> time series which I'm trying to do preliminary visualization on.
>>>
>>> One of my approaches uses the world coordinates as reported by the
>>> TransformIndexToPhysicalPoint method of OrientedImage.
>>>
>>> My problem is that even though I declare the image as 3D, it only has
>>> 1 slice, and the PhysicalPoints produced by the transformation all
>>> have a z value of 0. If I concatenate two slices together the results
>>> are as I expect. On the surface it looks like it might be a nifti
>>> loading issue
>>>
>>> The differences in image information are (interesting one last):
>>>
>>> single slice
>>>
>>>  RequestedRegion:
>>>    Dimension: 3
>>>    Index: [0, 0, 0]
>>>    Size: [256, 256, 1]
>>>  Spacing: [1.25, 1.25, 1]
>>>  Origin: [-160.625, -157.719, 0]
>>>  Direction:
>>> 1 0 0
>>> 0 1 0
>>> 0 0 1
>>>
>>>  IndexToPointMatrix:
>>>  1.25 0 0
>>> 0 1.25 0
>>> 0 0 1
>>>
>>>  PointToIndexMatrix:
>>>  0.8 0 0
>>> 0 0.8 0
>>> 0 0 1
>>>
>>> slice pair
>>>
>>>  RequestedRegion:
>>>    Dimension: 3
>>>    Index: [0, 0, 0]
>>>    Size: [256, 256, 2]
>>>  Spacing: [1.25, 1.25, 5]
>>>  Origin: [-160.625, -157.719, 9.70944]
>>>  Direction:
>>> 1 0 0
>>> 0 1 0
>>> 0 0 1
>>>
>>>  IndexToPointMatrix:
>>>  1.25 0 0
>>> 0 1.25 0
>>> 0 0 5
>>>
>>>  PointToIndexMatrix:
>>>  0.8 0 0
>>> 0 0.8 0
>>> 0 0 0.2
>>>
>>>
>>> Orthogonal slice
>>> ---------------------
>>>
>>>  RequestedRegion:
>>>    Dimension: 3
>>>    Index: [0, 0, 0]
>>>    Size: [192, 256, 1]
>>>  Spacing: [1.25, 1.25, 1]
>>>  Origin: [-29.0319, -91.3025, 0]
>>>  Direction:
>>> 0.479759 0.985709 0
>>> 0.8774 -0.168457 0
>>> 0 0 1
>>>
>>>  IndexToPointMatrix:
>>>  0.599698 1.23214 0
>>> 1.09675 -0.210571 0
>>> 0 0 1
>>>
>>>  PointToIndexMatrix:
>>>  0.142507 0.833862 0
>>> 0.742239 -0.405853 0
>>> 0 0 1
>>>
>>> Orthogonal slice pair
>>> --------------------------
>>>  RequestedRegion:
>>>    Dimension: 3
>>>    Index: [0, 0, 0]
>>>    Size: [192, 256, 2]
>>>  Spacing: [1.25, 1.25, 4]
>>>  Origin: [-29.0319, -91.3025, 135.198]
>>>  Direction:
>>> 0.47975 0.0179872 -0.877221
>>> 0.877385 -0.00307401 0.479777
>>> 0.00593328 -0.999833 -0.0172565
>>>
>>>  IndexToPointMatrix:
>>>  0.599688 0.0224841 -3.50888
>>> 1.09673 -0.00384251 1.91911
>>> 0.0074166 -1.24979 -0.069026
>>>
>>>  PointToIndexMatrix:
>>>  0.3838 0.701908 0.00474662
>>> 0.0143898 -0.00245921 -0.799867
>>> -0.219305 0.119944 -0.00431412
>>> _______________________________________________
>>> 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 ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>
>


More information about the Insight-developers mailing list