Search in sources :

Example 1 with FileInfo

use of ij.io.FileInfo in project GDSC-SMLM by aherbert.

the class PSFCreator method createNote.

private String createNote() {
    StringBuilder sb = new StringBuilder();
    sb.append(new SimpleDateFormat("'Created:' d-MMM-yyyy HH:mm").format(new Date())).append("\n");
    FileInfo info = imp.getOriginalFileInfo();
    if (info != null) {
        sb.append("File: ").append(info.fileName).append("\nDir: ").append(info.directory);
    } else {
        sb.append("Title: ").append(imp.getTitle());
    }
    sb.append("\n");
    return sb.toString();
}
Also used : FileInfo(ij.io.FileInfo) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 2 with FileInfo

use of ij.io.FileInfo in project GDSC-SMLM by aherbert.

the class IJImageSource method initialise.

private boolean initialise(ImagePlus imp) {
    imageArray = null;
    imageStack = null;
    if (imp == null)
        return false;
    ImageStack s = imp.getImageStack();
    if (s.isVirtual()) {
        // We must use the image stack to get the image data for virtual images
        imageStack = s;
    } else {
        // We can access the image array directly
        imageArray = s.getImageArray();
    }
    width = imp.getWidth();
    height = imp.getHeight();
    // Store the number of valid frames
    if (singleFrame > 0)
        frames = 1 + this.extraFrames;
    else
        frames = imp.getStackSize();
    slice = 0;
    FileInfo info = imp.getOriginalFileInfo();
    if (info != null)
        path = info.directory + info.fileName;
    return true;
}
Also used : ImageStack(ij.ImageStack) FileInfo(ij.io.FileInfo)

Aggregations

FileInfo (ij.io.FileInfo)2 ImageStack (ij.ImageStack)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1