Hi, Ingo,
PDL::Transform itself deals with coordinate transformations alone. So you are
tasked with tracking the transformations between different frames. It provides
a collection of parameterized transformation constructors and a basic syntax
for composing and inverting those transformations objects. You can apply a
transformation to vector data arranged as row vectors (e.g., if your data have
four independent variables, they are expected to have a dim 0 of size 4), or
map an image whose index variables are related to the values of the independent
variables. That functionality doesn’t require tracking anything in particular
beyond the coordinate transformation that you are using: all the parameters
are encapsulated in the transformation object.
But PDL::Transform *does* have the ability to interpret and use the World
Coordinate System (WCS), which is a part of the Flexible Image Transport System
(FITS) standard. FITS files include metadata stored as keyword/value pairs in
ASCII, human-readable punch-card analogs in a fixed-length header record at the
beginning of the image. FITS headers are close enough to Perl hashes that you
can place one in the hash-ref header field of a PDL. (This is made easier by
the Astro::FITS::Header module, which creates a tied hash that behaves exactly
like a FITS header, but that isn’t strictly necessary).
WCS uses certain keywords in the FITS header to represent parameters of a
transformation relating pixel index to actual scientific parameters.
PDL::Transform can interpret those keywords automagically, so you can deal with
the underlying physical coordinates rather than the raw pixel indices. That
part of the code is extremely well tested and mature for images, but less well
tested for higher dimensionality (though it should work and has worked in some
applications). The FITS header interpretation currently only deals with the
linear portion of FITS headers: for about 5-6 years there has been a standard
for a family of nonlinear transformations that can be specified (to deal with
telescope distortions of various kinds) but these have not been implemented.
Cheers,
Craig
> On Oct 31, 2016, at 3:35 AM, Ingo Schmid <[email protected]> wrote:
>
> Hi,
>
> finally I have to really face the issue of using real-world coordinates for
> my piddles. So far, I've ignored rotations, which I no longer can do. I guess
> there are already a couple of implementations of at least some of the
> features I need, so before I reinvent the wheel I wanted to ask if you could
> point me to some solution.
>
> Basically, I have data in cuboids in space with arbitrary rotation,
> translation and pixel scaling. Now I would like to e.g. extract data from the
> same spatial volume or add them together, etc. They may have extra dimensions
> as well, some without equally spacing, some with non-numeric coordinates.
>
> I guess PDL::Transform is good for that.
>
> How do you effectively store and attach/receive the information? I guess as
> translation/rotation/scaling vectors in the header and some methods to
> translate the slicing? How to translate this to an arbitrary number of
> dimensions?
>
>
> Ingo
>
> ------------------------------------------------------------------------------
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik_______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general