Login  Register

Re: Pointing to a fixed directory structure

Posted by David Webster on Oct 14, 2009; 8:43pm
URL: http://imagej.273.s1.nabble.com/Pointing-to-a-fixed-directory-structure-tp3690781p3690785.html

I copied your code with mods to read my own test image. I was able to find
some problems.

First, by the way you use it,

imagePath3 = IJ.openAsString(imagePath2);

seems intended to return a full path file spec. But I think it actually
returns the file pointed to by imagePath2 as a ASCII string. So, I just
commented this out and used

ImagePlus rgbBackGround = IJ.openImage(imagePath2);

Then, the statement

int[] bg_pixels = (int[]) bg_ip.getPixels();

got an error relating to casting a byte type to an int type (I think). I'm
still not sure about this, but as the statement isn't needed to do the

rgbBackGround.show();

I commented it out and then the thing ran OK.

I will check so more as time allows.

David Webster