<div dir="ltr"><div><div><div><div><div><div><div>Hi Michael,<br><br></div> I was only able to reproduce this when trying to create a SubRegion for Axes that weren't present.<br><br></div> 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).<br>

<br></div> 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.<br>

<br></div> 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 <a href="https://github.com/scifio/scifio/issues/19">N-dim ticket</a> to test this.<br>

<br></div> 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?<br><br></div> 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. :)<br>

<br></div>Thanks,<br>Mark<br><div><div><div><div><div><br>  <br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 23, 2013 at 2:55 AM, Michael Zinsmaier <span dir="ltr"><<a href="mailto:michael.zinsmaier@gmx.de" target="_blank">michael.zinsmaier@gmx.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi together,<br>
<br>
defining intervals via the ImgOptions mechanism seems not to work if you define an Interval only for one Axes (except for Channel).<br>
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<br>
new SubRegion(new AxesType[]{Time}, new Range[]{0}). An array index out of bounds exception is thrown.<br>
<br>
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.<br>
<br>
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.<br>
I hope thats correct if not I would like to suggest to change it.<br>
<br>
Best regards<span class="HOEnZb"><font color="#888888"><br>
Michael<br>
</font></span></blockquote></div><br></div>