PreibischLab / BigStitcher

ImgLib2/BDV implementation of Stitching for large datasets
GNU General Public License v2.0
68 stars 15 forks source link

"Batch Processing - Define dataset" leads to neverending macro #69

Closed martinschorb closed 4 years ago

martinschorb commented 4 years ago

Hi again,

now, I am trying to run the stitching as batch.

I record the macro using the batch tools, while recording the conversion works nicely (and fast).

When I then try to run the macro again, it gives me a 0 in the log and nothing happens but the macro running indefinitely.

run("Define dataset ...", "define_dataset=[Automatic Loader (Bioformats based)] project_filename=dataset00.xml path=B:/schorb/data/BDV/montages/mont/m1*.tif exclude=10 pattern_0=Tiles move_tiles_to_grid_(per_angle)?=[Do not move Tiles to Grid (use Metadata if available)] how_to_load_images=[Re-save as multiresolution HDF5] dataset_save_path=B:/schorb/data/BDV/montages/mont check_stack_sizes subsampling_factors=[{ {1,1,1}, {2,2,1}, {4,4,1}, {8,8,1} }] hdf5_chunk_sizes=[{ {128,64,1}, {64,64,1}, {64,64,1}, {64,32,1} }] timepoints_per_partition=1 setups_per_partition=0 use_deflate_compression export_path=B:/schorb/data/BDV/montages/mont/dataset00");

When I do the same macro as java plugin it gives me the following error:

Started macro1.java at Tue Mar 24 09:36:43 CET 2020
javax.script.ScriptException: Class My_Plugin in invalid directory: B:\schorb\data\BDV\montages\mont\macro1.java
    at org.scijava.plugins.scripting.java.JavaEngine.getMavenProject(JavaEngine.java:521)
    at org.scijava.plugins.scripting.java.JavaEngine.access$700(JavaEngine.java:96)
    at org.scijava.plugins.scripting.java.JavaEngine$Builder.initialize(JavaEngine.java:405)
    at org.scijava.plugins.scripting.java.JavaEngine$Builder.access$100(JavaEngine.java:364)
    at org.scijava.plugins.scripting.java.JavaEngine.compile(JavaEngine.java:197)
    at org.scijava.plugins.scripting.java.JavaEngine.eval(JavaEngine.java:136)
    at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:228)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
java.lang.IllegalArgumentException: Unknown code type: null
    at org.scijava.run.RunService.run(RunService.java:63)
    at org.scijava.plugins.scripting.java.JavaEngine.eval(JavaEngine.java:137)
    at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:228)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
martinschorb commented 4 years ago

Update: "Load TileConfiguration from File..." works from macro on the dataset just created

StephanPreibisch commented 4 years ago

Hi, for me it works fine:

run("Define dataset ...", "define_dataset=[Automatic Loader (Bioformats based)] project_filename=dataset.xml path=/Users/spreibi/Downloads/tiles/*.tif exclude=10 pattern_0=Tiles move_tiles_togrid(per_angle)?=[Move Tiles to Grid (interactive)] how_to_load_images=[Re-save as multiresolution HDF5] dataset_save_path=/Users/spreibi/Downloads/tiles check_stack_sizes subsampling_factors=[{ {1,1,1}, {2,2,1}, {4,4,1}, {8,8,1} }] hdf5_chunk_sizes=[{ {128,64,1}, {64,64,1}, {64,64,1}, {64,32,1} }] timepoints_per_partition=1 setups_per_partition=0 use_deflate_compression export_path=/Users/spreibi/Downloads/tiles/dataset");

StephanPreibisch commented 4 years ago

But it is an ImageJ Macro ... it seems like you run it as a Java class, not as an ImageJ macro?

martinschorb commented 4 years ago

Running it as an ImageJ macro gives me nothing bu 0 in the log and the macro keeps running. bigstitcher_macro1

I will test whether this is Windows-specific...

StephanPreibisch commented 4 years ago

Oh, please replace backslash \ with forward slash / ... that might be the reason

martinschorb commented 4 years ago

Seems to run in Linux (CentOS 7.7).

Putting \\ in the macro did the job. Standard ImageJ open() works with "/" It seems that BigStitcher Batch Processing does not replace the paths when running in Windows.

Cheers, Martin

StephanPreibisch commented 4 years ago

Yeah, sorry, usually ImageJ would have to do it as it does the recording. I implemented a hacky workaround that automatically replaces '\' with '/' if we are on windows and the macro recorder is running. This should hopefully solve the problem: https://github.com/PreibischLab/multiview-reconstruction/commit/7aeeca959e0c3c5f2ab3775e5f7a8f9a5dd12948 && https://github.com/PreibischLab/multiview-reconstruction/commit/974bb59ee38f01ec219d9544f93b3fcde87f6501

Screen Shot 2020-03-24 at 1 02 00 PM

It is also uploaded to Fiji now...