<div dir="ltr"><div>Hi Mark<br><br>Thanks for the fix. And thanks for the example code for making the command discoverable. <br><br></div>Brian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 4:52 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Ahh.. looks like this was just a general bug in opening TIFF data. Sorry that wasn't clear to me.<br>
<br></div>Anyway, it's fixed now locally. I'll release SCIFIO 0.8.2 tonight or tomorrow which will include the fix (you'll just have to update your pom-scijava to the latest version at that point).<br>
<br></div>Side note: you may want to define your CreatePhantomCommand (and other commands?) as discoverable IJ2 commands..<br><br>For example:<br><br>@Plugin(type=Command.class, menu = {<br> @Menu(label = MenuConstants.PLUGINS_LABEL,<br>
weight = MenuConstants.PLUGINS_WEIGHT,<br> mnemonic = MenuConstants.PLUGINS_MNEMONIC),<br> @Menu(label = "Truenorth", mnemonic = 't'), @Menu(label = "Create Phantom", weight = 1) })<br>
public class CreatePhantomCommand implements Command<br>{<br>...<br>}<br><br></div>Would make the CreatePhantomCommand discoverable by searching commands, or via the Plugin menu. Made testing in IJ2 a little easier for me..<br>
<br></div>Anyway, thanks again!<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">- Mark<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 3:01 PM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Mark<br><br></div><div>To clarify I was only changing the spacings to 0 as a hack to get around the error I was seeing. The code I was wondering about (around line 975 of TIFFFormat.java) is only called for spacing > 0.0. <br>
<br>You can repeat the error by running the CreatePhantomCommand we discussed a couple weeks ago. (I believe you retrieved the code and got it running but let me know if you need the instructions again). <br></div><div>
<br>
</div>The error can be repeated by running the CreatePhantomCommand to create a blank image and then trying to load the output into ImageJ2. The stack trace that I get from ImageJ2 is then as follows...<br><br><div><div>
<div><div><div>java.lang.IndexOutOfBoundsException: Index: 0, Size: 0<br> at java.util.ArrayList.rangeCheck(ArrayList.java:604)<br> at java.util.ArrayList.get(ArrayList.java:382)<br> at io.scif.AbstractMetadata.get(AbstractMetadata.java:138)<br>
at io.scif.formats.TIFFFormat$BaseTIFFParser.initMetadata(TIFFFormat.java:975)<br> at io.scif.formats.TIFFFormat$Parser.initMetadata(TIFFFormat.java:375)<br> at io.scif.formats.TIFFFormat$BaseTIFFParser.typedParse(TIFFFormat.java:645)<br>
at io.scif.formats.TIFFFormat$BaseTIFFParser.typedParse(TIFFFormat.java:627)<br> at io.scif.AbstractParser.parse(AbstractParser.java:326)<br> at io.scif.AbstractParser.parse(AbstractParser.java:105)<br> at io.scif.AbstractParser.parse(AbstractParser.java:59)<br>
at io.scif.AbstractReader.setSource(AbstractReader.java:217)<br> at io.scif.services.DefaultInitializeService.initializeReader(DefaultInitializeService.java:96)<br> at io.scif.img.ImgOpener.createReader(ImgOpener.java:365)<br>
at io.scif.img.ImgOpener.openImg(ImgOpener.java:147)<br> at imagej.data.DefaultDatasetService.open(DefaultDatasetService.java:254)<br> at imagej.data.io.DatasetIOPlugin.open(DatasetIOPlugin.java:82)<br> at imagej.data.io.DatasetIOPlugin.open(DatasetIOPlugin.java:54)<br>
at imagej.io.DefaultIOService.open(DefaultIOService.java:87)<br> at imagej.plugins.commands.io.OpenFile.run(OpenFile.java:85)<br> at imagej.command.CommandModule.run(CommandModule.java:196)<br> at imagej.module.ModuleRunner.run(ModuleRunner.java:170)<br>
at imagej.module.ModuleRunner.call(ModuleRunner.java:131)<br> at imagej.module.ModuleRunner.call(ModuleRunner.java:70)<br> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)<br> at java.util.concurrent.FutureTask.run(FutureTask.java:166)<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br> at java.lang.Thread.run(Thread.java:724)<br>
</div></div></div></div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 3:40 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Brian,<br><br></div> Sorry to hear that some tests are failing for you now.<br><br></div>
It does sound like there could be a bug here, but I will need more information to track it down. <br>
<br> Which tests are you running exactly, and what's the stack trace you get? If you could provide a minimal set of steps to reproduce the error, that would be great. Also, where are you setting the pixel size to be 0? (as a side note, a value of 1.0 might be safer.. which is what these axes are supposed to default to)<br>
<br></div><div>Thanks!<span><font color="#888888"><br>Mark<br></font></span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 9:57 AM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Mark<br><br></div>Hope you had a good holiday. I noticed some tests of mine failing just after Christmas. I think the failure possibly has something to do with a change in setting pixel size when loading. Right around line 1000 in this commit. <br>
<div><div><br><a href="https://github.com/scifio/scifio/commit/232261b978cbaeb42eb28c67cdddb7aca1acb1b6" target="_blank">https://github.com/scifio/scifio/commit/232261b978cbaeb42eb28c67cdddb7aca1acb1b6</a><br><br></div><div>
If you remember I have a script SimpleCreatePhantoms.sh which creates a blank image then places a sphere in it. It now fails in the second step because it cannot reload the blank image. I also cannot reload the newly created blank image into the latest build of ImageJ.<br>
<br></div><div>I have a workaround (set pixel size to zero since I am not actually using it right now) so it isn't critical but thought I'd let you know about a potential bug. <br></div><span><font color="#888888"><div>
<br></div><div>Brian <br>
</div></font></span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 3:32 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>No problem. That "error" message when failing to create services is confusing.<br><br>
</div>Glad it's working, let us know if you have any more problems!<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">- Mark<br></font></span></div><div>
<div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 2:19 PM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Mark<br><br></div>I just checked and It did work after all... I actually never checked to see if the final output was created. I just saw the exception and assumed it had stopped. <br>
<br>So everything appears great now,. Looks like the floating point numbers are being saved correctly. <br>
<br></div>Thanks for the fix<span><font color="#888888"><br><br>Brian<br>
</font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 2:46 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Hi Brian,<br><br></div> So, running your CreatePhantomCommand via the DeconvolutionTest class actually creates a blank image for me... I ran it from Eclipse directly though.<br><br></div><div> Also, I did observe the same error message that you saw, but the message was just logged and execution continued (because the services that failed to instantiate weren't necessary for execution.. so the "error" nature of the message is a bit of an overstatement in this case).<br>
<br> It is possible that some classes in SCIFIO erroneously have required services that aren't available in headless mode, but nothing stood out to me as suspicious.<br>
</div><div><br></div><div>Could you do two more things for me:<br><br></div><div>1) Try running your scripts without using a headless IJ2 to verify this works on your end.<br><br></div><div>2) Set the Java system property: "scijava.log.level=4" and re-paste the error output. This will turn full debugging on.<br>
<br></div><div>Thanks,<br>Mark<br>
</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 11:23 AM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi Mark<br><br></div>My code is here: <a href="https://github.com/bnorthan/projects" target="_blank">https://github.com/bnorthan/projects</a> -- be warned it is in need of some refactoring which I plan to do as ImageJ2 scripting becomes available. <br>
<br></div>A simple example of running my custom commands is in "SimpleCreatePhantoms.sh" (the other scripts will not work because of references to things on my own machine).<br><br></div>The code is for a project I did earlier in the year (<a href="http://spie.org/x648.xml?product_id=2002974" target="_blank">http://spie.org/x648.xml?product_id=2002974</a>).<br>
<br></div>The main program is called DeconvolutionTest.java... which has ended up evolving into a command parser. I never really polished it though because I am going to throw it away and use ImageJ2 scripting as that develops. A lot of things in the code base fall into that category, things I put together quickly but are meant to be replaced with the "proper" imagej2 component. <br>
<br></div>SimpleCreatePhantoms.sh just calls a command to create a blank phantom, then a second command to place a sphere in it. <br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Dec 16, 2013 at 9:09 AM, Mark Hiner <span dir="ltr"><<a href="mailto:hinerm@gmail.com" target="_blank">hinerm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>P.S. please feel free to send your commands via private e-mail, if you don't want them to be public.<br>
<br></div>Similarly, if you can share the dataset you're using that would be ideal... but no worries if it's proprietary or anything.<br>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 8:07 AM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>Hi Brian,<br><br></div> Ahhh.. I'm sorry! I misunderstood. If that's the actual stack trace then no, I don't think you are having any problems with the dependency tree, and all your pom settings should be fine given that stack trace.<br>
<br></div> Sidetrack: the pom-scijava doesn't actually have snapshot versions. It's basically just versioning glue - it defines a version properties to help ensure consistent versions of the various SciJava libraries (like SCIFIO) are consumed. Using 1.111 is fine, as we want to use the latest version of everything since SCIFIO-0.7.4/0.7.5 are quite new. Let me know if that's not clear...<br>
<br></div><div> Anyway, since we know it worked in 0.7.3, I would like to <a href="https://www.kernel.org/pub/software/scm/git/docs/git-bisect.html" target="_blank">bisect</a> and figure out what happened. However, I currently can't reproduce the issue. When I open a float dataset with SCIFIO 0.7.5 in IJ2 I'm able to write it as a .tif. So you're probably exposing a bug with other commands interacting with SCIFIO.<br>
<br></div><div> Can you share your custom commands? If not, could you let me know which commands you're calling?<br><br></div><div>Thanks,<br></div><div>- Mark<br></div><div><br><br></div></div></div>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 13, 2013 at 1:49 PM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Mark<br><br>I am using IJ2 in headless mode with some custom commands I wrote. So it is always possible that I still have old references somewhere. However that stack trace was actually generated with 0.7.4. When I had noted that 0.7.5-SNAPSHOT threw an exception, I went back to 0.7.4 to make sure that worked but it also had the same exception. Then I went back to 0.7.3 which worked (other than the floating point problem). <br>
<br></div>Below is the stack trace using 0.7.5-SNAPSHOT. (btw since I am using IJ2 maybe there is something else wrong in the dependency tree?? One of the IJ2 components?? Should I set the sci-java version to a SNAPSHOT version too?? It is 1.111 right now. <br>
<div><div><br> at org.scijava.Context.inject(Context.java:273)<br> at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:241)<br> at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:229)<br>
at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:220)<br> at org.scijava.plugin.AbstractSingletonService.createInstances(AbstractSingletonService.java:95)<br> at org.scijava.plugin.AbstractSingletonService.getInstances(AbstractSingletonService.java:73)<br>
at org.scijava.plugin.AbstractSingletonService$1.get(AbstractSingletonService.java:87)<br> at org.scijava.plugin.AbstractSingletonService$1.get(AbstractSingletonService.java:83)<br> at org.scijava.object.ObjectIndex.resolvePending(ObjectIndex.java:391)<br>
at org.scijava.object.ObjectIndex.get(ObjectIndex.java:136)<br> at org.scijava.object.DefaultObjectService.getObjects(DefaultObjectService.java:89)<br> at io.scif.codec.DefaultCodecService.getCodec(DefaultCodecService.java:65)<br>
at io.scif.formats.tiff.TiffCompression.compress(TiffCompression.java:330)<br> at io.scif.formats.tiff.TiffSaver.writeImage(TiffSaver.java:391)<br> at io.scif.formats.tiff.TiffSaver.writeImage(TiffSaver.java:279)<br>
</div>
at io.scif.formats.TIFFFormat$Writer.savePlane(TIFFFormat.java:1250)<br> at io.scif.formats.TIFFFormat$Writer.savePlane(TIFFFormat.java:1290)<div><br> at io.scif.AbstractWriter.savePlane(AbstractWriter.java:107)<br>
at io.scif.img.ImgSaver.writePlanes(ImgSaver.java:532)<br>
at io.scif.img.ImgSaver.saveImg(ImgSaver.java:380)<br> at io.scif.img.ImgSaver.saveImg(ImgSaver.java:133)<br> at io.scif.img.ImgSaver.saveImg(ImgSaver.java:114)<br><br></div></div></div><div><div>
<div class="gmail_extra"><br><br>
<div class="gmail_quote">On Fri, Dec 13, 2013 at 1:40 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hinerm@gmail.com" target="_blank">hinerm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra">Hi Brian,<br></div><div class="gmail_extra"><div class="gmail_quote"><div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br></div> I referenced the scifio 0.7.5-SNAPSHOT (would that be correct to get the absolute latest??)</div>
</div></blockquote><div><br></div></div><div>Yep this should be the latest snapshot.<br></div><div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
in my POM and ran into an exception when executing my code. </div></div></blockquote></div><div><br>...<br> <br></div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
at io.scif.formats.TIFFFormat$Writer.savePlane(TIFFFormat.java:1255)<br> at io.scif.formats.TIFFFormat$Writer.savePlane(TIFFFormat.java:1295)<br> at io.scif.AbstractWriter.savePlane(AbstractWriter.java:107)<br>
at io.scif.img.ImgSaver.writePlanes(ImgSaver.java:532)<br>
at io.scif.img.ImgSaver.saveImg(ImgSaver.java:380)<br> at io.scif.img.ImgSaver.saveImg(ImgSaver.java:133)<br> at io.scif.img.ImgSaver.saveImg(ImgSaver.java:114)<br></div></div></blockquote><div><br></div></div>
<div>That stack trace suggests that an older version of the TIFFFormat is being used. It must be from prior<a href="https://github.com/scifio/scifio/commit/379530aab9a9848e59363d87dcbdb79c4842bfc3" target="_blank"> commit 37953</a> (because the TiffSaver.writeImage call is now on line 1250, not 1255). I'm assuming it's from the 0.7.4 release.<br>
<br></div><div> Are you just running the code snippet that Curtis posted a while back (or your own similar snippet)? Or are you using SCIFIO in IJ2, or another application?<br><br></div><div> Could you run "mvn dependency:tree", or check the "Maven Dependencies" tab if you're using Eclipse? I'm assuming something must still have a 0.7.4 SCIFIO reference, which is being pulled in instead of 0.7.5...<br>
<br></div><div>Sorry for the inconvenience.. let me know what you find!<br><br></div><div>Thanks,<br>Mark<br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>