[Insight-developers] Re: [Insight-users] Image Coordinate Directions
Leila Baghdadi
baghdadi at sickkids.ca
Wed Mar 8 11:03:34 EST 2006
Hello Mark
I agree that not everything is taking direction cosines into account but
I am pretty sure it will be if not now in the near future.
I am in the process of looking over some of my code and I will make sure
I will double check for direction cosines.
As for documentation, I know that Insight developers specifically Master
Luis will take your suggestions into consideration,
Leila
On Wed, 2006-08-03 at 09:34 -0500, Mark Foskey wrote:
>
> Leila Baghdadi wrote:
> > Mark,
> >
> > I have written a fair bit of imaging code and I can tell you ignoring
> > direction cosines has always got me into trouble!
>
> Well, that's what I thought too, but my point was that everybody else,
> as far as I can tell, *is* ignoring the direction cosines. At least all
> the code in InsightApplications. And, judging by an earlier thread, at
> least one of the filters doesn't even propagate that information,
> although that may have been fixed.
>
> > I am pretty sure
> > some bugs were fixed on the main itk Imaging classes and you could
> > easily retrieve your direction cosines from your image header (or
> > however the information is stored depending on the image format) and
> > pass it to itk even if the direction cosines are identity
> >
> > i.e,
> > this->SetDirection(0, {1, 0, 0});
> > this->SetDirection(1, {0, 1, 0});
> > this->SetDirection(2, {0, 0, 1});
>
> Well, yes, that's what I do, except that they aren't identity so I set
> them accordingly. But when I link, for instance, InsightSNAP against my
> new library, the program completely disregards the direction information.
>
> Also, and this is directed more at the developers, I think perhaps the
> documentation of Get/SetDirection should be changed. It reads:
>
> "Get the direction cosines of the image. The direction cosines are
> vectors that point from one pixel to the next. For ImageBase and Image,
> the default direction is identity."
>
> I would suggest something like:
>
> "Get the direction vectors of the image. The direction vectors are unit
> vectors that point from one pixel towards the next. The components of
> the direction vectors are the direction cosines. For ImageBase and
> Image, the default direction vectors imply the identity transformation."
>
> This does a better job of keeping scalars, vectors, and matrices
> straight, and makes it clear to the reader that they should be unit
> vectors. Is this right? Do any developers want to make the change?
>
More information about the Insight-developers
mailing list