Skip to content

Commit a1d833d

Browse files
committed
FIX2/2: ImageTransferWizard macro records now and reports for Read/Write full images
1 parent 92c431c commit a1d833d

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cz.it4i.fiji.legacy;
22

3+
import ij.plugin.frame.Recorder;
34
import net.imagej.Dataset;
45
import org.scijava.ItemIO;
56
import org.scijava.command.Command;
67
import org.scijava.plugin.Parameter;
78
import org.scijava.plugin.Plugin;
89
import cz.it4i.fiji.legacy.common.ImagePlusTransferrer;
910

10-
@Plugin(type = Command.class, headless = true)
11+
@Plugin(type = Command.class, headless = true, name = "ReadIntoImagePlus - can't be used directly")
1112
public class ReadIntoImagePlus extends ImagePlusTransferrer {
1213
@Parameter(type = ItemIO.OUTPUT)
1314
public Dataset outDatasetImg;
@@ -18,7 +19,10 @@ public void run() {
1819
adjustReportingVerbosity();
1920

2021
outDatasetImg = readWithAType();
21-
if (showRunCmd)
22-
mainLogger.info("Corresponding IJM command: "+reportAsMacroCommand("Read Into Image"));
22+
if (showRunCmd) {
23+
final String howToRun = reportAsMacroCommand("Read full image");
24+
mainLogger.info("Corresponding IJM command: "+howToRun);
25+
Recorder.recordString(howToRun);
26+
}
2327
}
2428
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cz.it4i.fiji.legacy;
22

3+
import ij.plugin.frame.Recorder;
34
import net.imagej.Dataset;
45
import net.imglib2.img.Img;
56
import org.scijava.command.Command;
67
import org.scijava.plugin.Parameter;
78
import org.scijava.plugin.Plugin;
89
import cz.it4i.fiji.legacy.common.ImagePlusTransferrer;
910

10-
@Plugin(type = Command.class, headless = true)
11+
@Plugin(type = Command.class, headless = true, name = "WriteFromImagePlus - can't be used directly")
1112
public class WriteFromImagePlus extends ImagePlusTransferrer {
1213
@Parameter
1314
public Dataset inDatasetImg;
@@ -18,7 +19,10 @@ public void run() {
1819
adjustReportingVerbosity();
1920

2021
writeWithAType((Img)inDatasetImg);
21-
if (showRunCmd)
22-
mainLogger.info("Corresponding IJM command: "+reportAsMacroCommand("Write From Image"));
22+
if (showRunCmd) {
23+
final String howToRun = reportAsMacroCommand("Write full image");
24+
mainLogger.info("Corresponding IJM command: "+howToRun);
25+
Recorder.recordString(howToRun);
26+
}
2327
}
2428
}

src/main/java/cz/it4i/fiji/legacy/common/ImagePlusDialogHandler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,18 @@ public String reportAsMacroCommand(final String forThisCommand) {
434434
+" datasetid="+datasetID
435435
+" versionasstr="+versionAsStr
436436
+" resolutionlevelsasstr=["+resolutionLevelsAsStr+"]"
437-
+" minx="+minX
438-
+" maxx="+maxX
439-
+" miny="+minY
440-
+" maxy="+maxY
441-
+" minz="+minZ
442-
+" maxz="+maxZ
437+
//+" minx="+minX
438+
//+" maxx="+maxX
439+
//+" miny="+minY
440+
//+" maxy="+maxY
441+
//+" minz="+minZ
442+
//+" maxz="+maxZ
443443
+" timepoint="+timepoint
444444
+" channel="+channel
445445
+" angle="+angle
446446
+" timeout="+timeout
447-
+" verboselog="+verboseLog
448-
+" showruncmd="+showRunCmd+"\");";
447+
+" verboselog="+verboseLog+"\");";
448+
//+" showruncmd="+showRunCmd+"\");";
449449
}
450450

451451
protected void adjustReportingVerbosity() {

0 commit comments

Comments
 (0)