[Insight-users] Generating 4D ImageSource

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed May 7 15:40:15 EDT 2008


Hi Luis,

>  I would have expected that you would simply use Linear
>  image iterators in order to populate the pixels of your
>  4D image. This iterator will be a 4D one, and you would
>  be able to walk across the 4th dimension (time in this
>  case) with the inner loop of the iterator.

Correct, but you are only walking over [t1, t2] where t1,t2 are
defined by the SplitRequestRegion.
Since my function f(x,y,z) generate the whole signal over t, I need to
call it N times (where N is basically the number or thread running)
and only copy the [t1, t2] interval I am intersted in.

The function is actually so costly that a single threaded with a
single call to the function is actually faster than the threaded
version.

I have not thought of creating a 3D image made of N components, I might try it.

Thanks anyway,
-Mathieu

On Wed, May 7, 2008 at 7:50 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>  Hi Mathieu,
>
>  You are right, the ImageSource::SplitRequestedRegion() API
>  doesn't have an option for allowing you to select the axis
>  across which to split the dataset.
>
>  I'm a bit confused as to why do you need to customize this
>  at all...
>
>
>  I would have expected that you would simply use Linear
>  image iterators in order to populate the pixels of your
>  4D image. This iterator will be a 4D one, and you would
>  be able to walk across the 4th dimension (time in this
>  case) with the inner loop of the iterator.
>
>
>  Another option that you may want to consider is to represent
>  your image as a 3D image with N components per pixel, where
>  the N components correspond to the N instances of time in
>  your signal(t).
>
>
>  The choice of one representation over the other would mostly
>  depend on what kind of algorithms you anticipate that you
>  will be running in this data.
>
>
>
>    Regards,
>
>
>       Luis
>
>
>  -------------------------
>
>
>  Mathieu Malaterre wrote:
>
> > Hi there,
> >
> >  I am working on a very simple task: generate a 4D dataset in ITK. I
> > have a function f(x,y,z) which return a discretized signal(t)
> > function. So I want to loop over (x,y,z) and set all value on the last
> > dimension (t).
> >  However default implementation of ImageSource::SplitRequestedRegion
> > is splitting extents on the last dimension.
> >
> >  From the documentation, I do not understand how I can specify which
> > axis is to be split for the threaded execution.
> >
> > Thanks,
> >
>



-- 
Mathieu


More information about the Insight-users mailing list