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

ImageJ plugin - Group files Exception #1967

Merged
merged 5 commits into from
Sep 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ private void initializeFile() throws FormatException, IOException {

BF.status(options.isQuiet(), "Analyzing " + getIdName());
baseReader.setMetadataFiltered(true);
baseReader.setGroupFiles(!options.isUngroupFiles());
baseReader.setGroupFiles(!options.isUngroupFiles() || options.isGroupFiles());
if(options != null && !options.showROIs()){
MetadataOptions mo = baseReader.getMetadataOptions();
if(mo == null){
Expand All @@ -504,6 +504,8 @@ private void initializeFile() throws FormatException, IOException {
}
baseReader.setId(options.getId());

boolean mustGroup = baseReader.fileGroupOption(options.getId()) == FormatTools.MUST_GROUP;
options.setMustGroup(mustGroup);
}

/** Performed following ImportStep.STACK notification. */
Expand All @@ -515,7 +517,7 @@ private void initializeStack() throws FormatException, IOException {

// overwrite base filename with file pattern
String id = options.getId();
options.setId(id);
fileStitcher.setId(id);
fileStitcher.setUsingPatternIds(true);
fileStitcher.setCanChangePattern(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public class ImporterOptions extends OptionsList {
public static final String KEY_VIRTUAL = "virtual";
public static final String KEY_WINDOWLESS = "windowless";
public static final String KEY_STITCH_TILES = "stitchTiles";

public static final String KEY_MUST_GROUP = "mustGroup";

// possible values for colorMode
public static final String COLOR_MODE_DEFAULT = "Default";
public static final String COLOR_MODE_COMPOSITE = "Composite";
Expand Down Expand Up @@ -396,6 +397,11 @@ public boolean isViewView5D() {
public boolean doStitchTiles() { return isSet(KEY_STITCH_TILES); }
public void setStitchTiles(boolean b) { setValue(KEY_STITCH_TILES, b); }

// mustGroup
public String getMustGroupInfo() { return getInfo(KEY_MUST_GROUP); }
public boolean doMustGroup() { return isSet(KEY_MUST_GROUP); }
public void setMustGroup(boolean b) { setValue(KEY_MUST_GROUP, b); }

// -- ImporterOptions methods - secondary options accessors and mutators --

// series options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

package loci.plugins.in;

import ij.IJ;
import loci.common.StatusEvent;
import loci.common.StatusListener;
import loci.plugins.BF;
Expand Down Expand Up @@ -78,7 +79,13 @@ public void statusUpdated(StatusEvent e) {
if (!promptMain()) process.cancel();
break;
case STACK:
if (!promptFilePattern()) process.cancel();
ImporterOptions options = process.getOptions();
if (options != null && options.doMustGroup() && options.isGroupFiles()) {
IJ.showMessage("Bio-Formats",
"File Stitching Options are not available for files of this format.\n"
+ "Files will be grouped according to image format specifications.\n");
}
else if (!promptFilePattern()) process.cancel();
break;
case SERIES:
if (!promptSeries()) process.cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,8 @@ default = false
type = boolean
label = windowless
default = false

[mustGroup]
type = boolean
label = mustGroup
default = false