Re: Getting file info from ImagePlus objects
Posted by
danibodor on
Aug 12, 2009; 11:17am
URL: http://imagej.273.s1.nabble.com/Getting-file-info-from-ImagePlus-objects-tp3691500p3691501.html
getDirectory("image") - Returns the path to the directory that the active image was loaded from. (quote from ImageJ site).
Then using getTitle function gets the actual title of your image.
Thus you can write:
path = getDirectory("image")+getTitle();
simon andrews (BI) wrote
In a plugin I'm writing I'm trying to extract the full path to the
original image which is being processed. The images are TIFF stacks.
I've tried a few different methods, the most promising of which seemed
to be getFileInfo - but when I call this the object which is returned
has no value in its directory field, and a file name of Untitled.
The only place I've found any file information was in the getTitle()
method of ImagePlus which gets me the window title (which happens to
be the file name), but this doesn't get me the directory the image
came from and the pwd doesn't match this either.
How can I get this information?
Thanks
Simon.