[ITK Community] Fwd: Problems with slice extraction from a 3D image for directions different from z

Simon Wimmer wimmersimon at gmail.com
Sat Mar 8 20:42:29 EST 2014


Hi all,

as a follow up, I just checked the spacings in the original image and the
extracted slice.

reader->GetOutput()->GetSpacing()
gives
[0.747159, 0.747159, 6].

But
filter->GetOutput()->GetSpacing()
gives
[1, 1],
which explains the "loss of spacing information" I observed.
I guess if the spacing was preserved the filter->
SetDirectionCollapseToIndentity() setting would give me the desired slice
images.
Any tips on how I could track down the problem here?


Simon


2014-03-08 22:10 GMT+01:00 Luis Ibanez <luis.ibanez at kitware.com>:

> Hi Simon,
>
> On Sat, Mar 8, 2014 at 3:56 PM, Simon Wimmer <wimmersimon at gmail.com>wrote:
>
>>
>> My direction matrix is simply the identity.
>> So I would guess that in this case filter->SetDirectionCollapseToIndentity()
>> and filter->SetDirectionCollapseToSubmatrix() should do the same?
>>
>>
> It should...yes... I think.
>
> mm, maybe we need to take a closer look at the way the Submatrix is being
> composed:
>
>
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkExtractImageFilter.hxx#L223
>
>
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkExtractImageFilter.hxx#L188
>
>
>
>
>> Taking out  InPlaceOn() sounds reasonable.
>>
>
> OK
>
>
>>  Regarding the spacing issue my intuition would have been that the
>> extraction of course destroys the information for the projection direction,
>>  but should preserve it for the other ones. Is that correct?
>>
>
> Yes, that's correct.
>
> So, if the initial 3D image had spacing values
>
>         1.7,  2.9,   3.1
>
> in X, Y, Z respectively,
>
>
> and you collapse Z,
> you should end up with a 2D image with spacing values
>
>          1.7,   2.9
>
> in X and Y respectively.
>
>
>   HTH
>
>
>       Luis
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140309/40d23544/attachment-0002.html>


More information about the Community mailing list