[SCIFIO] ImgOpener - ImgOptions - SubRegions

Mark Hiner hinerm at gmail.com
Fri Aug 23 08:51:57 CDT 2013


Hi Michael,

 I was only able to reproduce this when trying to create a SubRegion for
Axes that weren't present.

 In the case of ImgOpener, Axes of length 1 are discarded... so they
effectively "aren't present" and can't have a SubRegion applied to them
(since they are implicitly included anyway in the image).

 Unfortunately, I'm not sure how to make the error reporting better, in
general, on this issue.. since, when constructing a SubRegion, there's no
way to know what dataset(s) it will be applied to... it's up to the
consuming software to use the SubRegion information when reading the
dataset.

 I could add some defensive checks to verify that axes are present.. but
this whole system is going to be reworked in 0.7.0 for N-dimensionality. So
I'm going to add a comment to our N-dim
ticket<https://github.com/scifio/scifio/issues/19>to test this.

 For now, in your code, can you check if an axis length is < 2 before
creating the SubRegion, and if so - don't add it to the SubRegion
specification?

 Oh - if you are getting this issue for Axes you know have a length > 1,
send me the dataset, because something else is going on there. :)

Thanks,
Mark




On Fri, Aug 23, 2013 at 2:55 AM, Michael Zinsmaier <michael.zinsmaier at gmx.de
> wrote:

> Hi together,
>
> defining intervals via the ImgOptions mechanism seems not to work if you
> define an Interval only for one Axes (except for Channel).
> E.g. consider that you want to select only time=0 from a 5dim Image
> (x,y,Channel,z,Time) and define the SubRegion as follows
> new SubRegion(new AxesType[]{Time}, new Range[]{0}). An array index out of
> bounds exception is thrown.
>
> It does however work if you do the same thing with Channel and it works
> also if you specify Ranges for Channel, Z and Time.
>
> The API of SubRegion (Map Constructor) gives me the feeling that is should
> not be necessary to specify Axes that I want to include completly.
> I hope thats correct if not I would like to suggest to change it.
>
> Best regards
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://scif.io/pipermail/scifio/attachments/20130823/7a69e006/attachment-0002.html>


More information about the SCIFIO mailing list