Closed snehashis-roy closed 3 years ago
Since the merge step must write output files on disk, to parallelize execution you must generate an output image divided in multiple files, so as each process write a different file to disk (see our paper on parallelization for more details). Since your output format is a series of 2D images it is sufficient that you give a positive value to option --slicedepth. I suggest a value of 1 if your image is large in X-Y, or a relatively small integer if the image is not so large in X-Y, but consists of many slices. Consider also that current version of parastitcher does not accepts options: --imin_channel --imout_format --imout_depth --stitchablesonly (defaults should work well in your case).
Since the merge step must write output files on disk, to parallelize execution you must generate an output image divided in multiple files, so as each process write a different file to disk (see our paper on parallelization for more details). Since your output format is a series of 2D images it is sufficient that you give a positive value to option --slicedepth. I suggest a value of 1 if your image is large in X-Y, or a relatively small integer if the image is not so large in X-Y, but consists of many slices. Consider also that current version of parastitcher does not accepts options: --imin_channel --imout_format --imout_depth --stitchablesonly (defaults should work well in your case).
Thank you. So in my case, the arguments should be this.
mpirun -np 6 python parastitcher.py --merge --projin=parastitcher/result/placetiles.xml
--volout=parastitcher/result --volout_plugin="TiledXY|2Dseries" --resolutions=0
--slicewidth=6092 --sliceheight=9456 --slicedepth=1 --imout_plugin=tiff2D --algorithm=SINBLEND
Is there a way to know what the stitched image size would be before running this merge step? I can not find the stitched image height/width (i.e. 6092 and 9456) in the placetiles.xml.
Right. You may specify -1 for options --slicewidth and --sliceheight. You can know the image size running teraconverter with option --info=file_name and other needed options (i.e. -s, --sfmt, --dfmt, the last one useless in this case, but nevertheless required) in file_name you will find the following information (values are dummy): HEIGHT=1892 WIDTH=1892 DEPTH=5 BYTESxCHAN=2 DIM_C=1 VXL_V=0.520000 VXL_H=0.520000 VXL_D=1.000000
Thank you. This worked out nicely.
Is there any possibility for the Parastitcher that is compatible with Python 3?
Yes, the current script should work also with Python3. Let me know if you have any problems.
Yes, the current script should work also with Python3. Let me know if you have any problems.
Thank you. It worked with Python 3.6.10.
Right. You may specify -1 for options --slicewidth and --sliceheight.
This method did not work for me with parastitcher 3.2.3, terastitcher 1.11.10. I get the error that @piby2 originally got above:
ZeroDivisionError: float division by zero
when using --sliceheight=-1 --slicewidth=-1 --slicedepth=1
.
or can know the image size running teraconverter with option --info=file_name and other needed options (i.e. -s, --sfmt, --dfmt, the last one useless in this case, but nevertheless required)
This also did not work for me, but I'm not as familiar with teraconverter so this could be down to an improper setup on my end. The first time I tried to run this was after running the first 5 steps of terastitcher (i.e. up to Align but before merge). At this point my input folder looked like this:
├── 114510
├── 148100
├── 181690
├── mdata.bin
├── xml_displcomp.xml
├── xml_displproj.xml
├── xml_displthres.xml
├── xml_import.xml
└── xml_placetiles.xml
where I am using the two-level file hierarchy. When I tried to run teraconverter to determine the width and height dimensions of the stitched volume:
teraconverter -s="/jukebox/wang/ahoag/test_stitching_mpi/data" --sfmt="TIFF (tiled, 2D)" --dfmt="TIFF (series, 2D)" -d="/jukebox/wang/ahoag/test_stitching_mpi/stitched"
I got this error:
ERROR: in Stack::unBinarizeFrom(...): error while reading binary metadata file
I moved the mdata.bin
file in my folder data
somewhere else and re-ran the same command and got this error:
ERROR: in StackedVolume::StackedVolume(...): unable to find metadata file at /jukebox/wang/ahoag/test_stitching_mpi/data/mdata.bin
The whole point for me doing all this is to identify the dimensions of my stitched data before running terastitcher at all so that I can set up the script ahead of time to run all terastitcher steps in a dependency slurm chain. However, I found that when you run the merge step with parastitcher you can just pass --slicewidth and --sliceheight parameters that are very much larger than what you know the real dimensions will be. If you do this, the code will end up using the correct dimensions. For example, I have a dataset that will turn out to be 7382x5642x3540
(I know this from manually running the merge step as a test). I am able to run the merge step and have it produce complete z planes without chunking them up in x and y and without knowing the output dimensions ahead of time by doing this:
mpirun -np 9 parastitcher.py -6 --projin=/jukebox/wang/ahoag/test_stitching_mpi/da/xml_placetiles.xml --volout=/jukebox/wang/ahoag/test_stitching_mpi/stitched --resolutions=0 --sliceheight=20000 --slicewidth=20000 --slicedepth=1
Hello. I want to run the merge step with parastitcher. My specs are,
I have downloaded the parastitcher.py RELEASE 3.2.3.
This is how I normally run the step 6,
This is how I tried to use the parastitcher.py
This is the error that I got,
The merge step with terastitcher successfully works though. The xml files generated before the merge step are attaches.
xmls.zip
My images are saved as 4x3 mosaic, where each tile is a 3D image of size 2560x2160x2502 (HxWxD)
Please let me know how to run the Parastitcher correctly.