Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewsExample2.java #1

Open
user-na opened this issue Jun 17, 2016 · 2 comments
Open

ViewsExample2.java #1

user-na opened this issue Jun 17, 2016 · 2 comments

Comments

@user-na
Copy link

user-na commented Jun 17, 2016

In ViewsExample2.java the first step is to open an image via an IJ instance.
As far as I can see IJ tries to open the image from the network when I do
IJ.run("T1 Head (2.4M, 16-bits)");.
As I am behind a restrictive firewall, calling this method failed for me. To fix this for me, I changed the opening command to
IJ.run("$localPathToProject$\\images\\t1-head.tif"),
using the file which was distributed with the workshop. Doing so, the image opens as expected.
So far so good.

The point is that the provided image seems to be of UnsignedByteType and not UnsignedShortType. So the wrapping into an Img fails:
Img< UnsignedShortType > img = ImageJFunctions.wrapShort( imp );

Am I doing something wrong, or can you confirm this?

@tpietzsch
Copy link
Member

I can confirm this. The reason is that really the t1-head.tif file included in the workshop is 8-bit, while the "T1 Head (2.4M, 16-bits)" that IJ downloads is 16-bit. I don't remember what the reason (if any) for including the 8-bit file was...

In any case, for the case of unavailability of the online "T1 Head", there is ViewsExample2Alternative which uses the local file (and loads it as UnsignedByteType)

@user-na
Copy link
Author

user-na commented Jun 17, 2016

I did the tutorial step-by-step and did not look at the alternative before digging deep into looking for the reason oft the cash. I learned a lot by locating the issue. Never the less, from a user point oft view I would suggest to introduce a comment in the ViewsExample2 which mentions that the alternative covers the case for the shipped image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants