[Insight-developers] Adding ValueType to itk::Image

Jisung Kim bahrahm@yahoo.com
Thu, 21 Feb 2002 14:33:45 -0800 (PST)


You are right, Luis. 
It can be several classes with similar names with 99% 
code duplicates unless I can find a work-around.

I think I might have a work-around for the problem.

I have two Accessor classes for ImageToListAdaptor,
ScalarImageAccessor (scalar pixel type image)and
VectorImageAccessor (vector pixel type image). 
Users can specify which one the ImageToListAdaptor
object will use by change the template parameter for
accessor. So all Get/Set method calls in
ImageToListAdaptor are calling corresponding methods
in  Accessor class. I think I can use the same
mechanism for PointSet. However, since my accessor
scheme involves conversions of data and multiple
calls, it is bad for performance. I didn't test the
performance difference between accessor version with
non-accessor version. Same problem will happen with
PointSetToListAdaptor if I use the same scheme.

This reduces duplicated code but introduces
performance problem. }}: - (

I don't know the answer here.

Thank you,

Jisung.



--- Luis Ibanez <luis.ibanez@kitware.com> wrote:
> 
> Jisung,
> 
> How about managing that at the level of the
> SampleListAdaptors ?
> 
> I guess we have now:
> 
>    ImageToSampleListAdaptor
>    PointSetToSampleListAdaptor
> 
> 
> We  could have two (or more) Adaptors for PointSets.
> One of them mapping PointType to ValueType (for
> points
> that are already representing the parametric space)
> and
> another for mapping PixelType to ValueType (for
> points
> in world space with data associated with them)
> 
> 
> It will be fun to find names for them though        
>    :-)
> 
> 
> Luis
> 
> ---------------------------------
> 
> Jisung Kim wrote:
> 
> >Hi Jim.
> >
> >I think you are right. The original idea was using
> >only the Point (position in feature space, not in
> >normal space(?)). I believe Luis used PointSet to
> >represent parameters in parametric space in his
> >Curves2DExtractor example, and the original idea
> was
> >extension of his idea. However, as you pointed out,
> >since PointSet has distinction between Point and
> >PointData, and has two containers for them, simply
> >ignoring PointData would not be a good call.
> >
> >I have to think about a way to allow users to
> choose
> >Point, PointData, or union of both as measurement
> >vector type.
> >
> >And the question of ValueType is really ambiguous
> >here.
> >
> >Without any objection, I will add ValueType to
> Image
> >tomorrow, but not PointSet. If anyone has an good
> >idea, please let me know.
> >
> >Thank you,
> >
> >Jisung.
> >
> >
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
>
http://public.kitware.com/mailman/listinfo/insight-developers


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com