abria / TeraStitcher

A tool for fast automatic 3D-stitching of teravoxel-sized microscopy images
http://abria.github.io/TeraStitcher/
Other
82 stars 32 forks source link

Problem stitching 2D RGB images using the command line tools #21

Open mary-alegro opened 7 years ago

mary-alegro commented 7 years ago

Hi all,

Thanks for the great work in TeraStitcher! I'd like to know if it would be possible to stitch 2D RGB images using the command line tools. I'm able to do it using the GUI. However, I'm having trouble doing the same in the command line. I can run the pipeline just fine using the following:

terastitcher --import --projin="xml_import.xml" --imin_channel="G"
terastitcher --displcompute --projin="xml_import.xml" --imin_channel="G"
terastitcher --displproj --projin="xml_displcomp.xml" --imin_channel="G"
terastitcher --displthres --threshold=0.7 --projin="xml_displproj.xml" --imin_channel="G"
terastitcher --placetiles --projin="xml_displthres.xml" --imin_channel="G"
terastitcher --merge --projin="xml_merging.xml" --volout="output" --volout_plugin="TiledXY|3Dseries" --imout_format="tif" --imin_channel="G"

but if I try to use all color channels with --imin_channel="all" I get the error:

ERROR: in virtual iom::real_t *volumemanager::Stack::loadImageStack(int, int): conversion from multi-channel to intensity images not supported.

I'm running TeraStitcher standalone version 1.10.5 on MacOS El Capitan. I'd really appreciate some advice on how to stitch my color images.

Thank you!

mary-alegro commented 7 years ago

I was able to do it using teraconverter! However, if I try to use the HDF5 output file format for BigDataViewer I get the following:

HDF5-DIAG: Error detected in HDF5 (1.8.16) thread 0:

000: /Users/Administrator/Projects/hdf5-1.8.16/hdf5-1.8.16/src/H5G.c line 812 in H5Gclose(): not a group

major: Invalid arguments to routine 
rmd13 commented 5 years ago

How to specify which R/G/B to be used to stitch in .xml file? I use GUI version to stitch 2 RGB images, but on the first step preview, I got the same error.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE TeraStitcher SYSTEM "TeraStitcher.DTD">
<TeraStitcher volume_format="TiledXY|2Dseries" input_plugin="tiff2D">
    <stacks_dir value="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\" />
    <ref_sys ref1="1" ref2="2" ref3="3" />
    <voxel_dims V="1" H="1" D="1" />
    <origin V="7" H="15.8088" D="13.899" />
    <mechanical_displacements V="1870" H="2270" />
    <dimensions stack_rows="1" stack_columns="2" stack_slices="1" />
    <STACKS>
        <Stack N_CHANS="3" N_BYTESxCHAN="1" ROW="0" COL="0" ABS_V="0" ABS_H="0" ABS_D="0" STITCHABLE="no" DIR_NAME="1" Z_RANGES="[0,1)" IMG_REGEX="">
            <NORTH_displacements />
            <EAST_displacements />
            <SOUTH_displacements />
            <WEST_displacements />
        </Stack>
        <Stack N_CHANS="3" N_BYTESxCHAN="1" ROW="0" COL="1" ABS_V="0" ABS_H="2416" ABS_D="0" STITCHABLE="no" DIR_NAME="2" Z_RANGES="[0,1)" IMG_REGEX="">
            <NORTH_displacements />
            <EAST_displacements />
            <SOUTH_displacements />
            <WEST_displacements />
        </Stack>
    </STACKS>
</TeraStitcher>
rmd13 commented 5 years ago

Eventhough the preview step get an error, I can run the stiching process using the tab2 and tab3 of GUI, and got a merged image!

However, I do not know how to pass some additional parameters that not show up in xml file,such as sV,sH,sD in step 2.

iannellog commented 5 years ago

The channel to be used in input is specified through a command line option (--imin_channel) and it is not specified in the xml (i.e. it can be chosen dinamically). If you use the GUI there are popup lists in all tabs that allow you to select the channel (in the merge tab you have to enable "advanced options"). Using TeraConverter you can generate the final fused image with more than one channel (even with all). See the TeraTools Guide downloadable from the GitHub site for more details. Best.

-- Giulio

Il giorno dom 3 feb 2019 alle ore 15:44 rmd06 notifications@github.com ha scritto:

How to specify which R/G/B to be used to stitch in .xml file? I use GUI version tyo stitch 2 RGB images, but on the first step I got the same error.

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE TeraStitcher SYSTEM "TeraStitcher.DTD">

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/21#issuecomment-460057849, or mute the thread https://github.com/notifications/unsubscribe-auth/AIdv1h_o7cfGlsX6_fCyhNwbFa77NCKFks5vJvXEgaJpZM4PejPf .

--


Giulio Iannello Preside della Facolta' Dipartimentale di Ingegneria Universita' Campus Bio-Medico di Roma v. Alvaro del Portillo, 21 00128 Roma, Italy

Tel: +39-06-22541-9602 E-mail: g.iannello@unicampus.it Fax: +39-06-22541-9609 URL: https://scholar.google.it/citations?user=L-UJxIgAAAAJ


iannellog commented 5 years ago

enable the advanced options in the Align tab (sV, sH, sD parameters are named "Search Region")

-- Giulio

Il giorno dom 3 feb 2019 alle ore 15:59 rmd06 notifications@github.com ha scritto:

Eventhough the preview step get an error, I can run the stiching process using the tab2 and tab3 of GUI, and got a merged image!

However, I do not know how to pass some additional parameters that not show up in xml file,such as sV,sH,sD in step 2.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/21#issuecomment-460058960, or mute the thread https://github.com/notifications/unsubscribe-auth/AIdv1ifwHObNhlILWSmTewfms0p0G4nvks5vJvkwgaJpZM4PejPf .

--


Giulio Iannello Preside della Facolta' Dipartimentale di Ingegneria Universita' Campus Bio-Medico di Roma v. Alvaro del Portillo, 21 00128 Roma, Italy

Tel: +39-06-22541-9602 E-mail: g.iannello@unicampus.it Fax: +39-06-22541-9609 URL: https://scholar.google.it/citations?user=L-UJxIgAAAAJ


rmd13 commented 5 years ago

Hi all,

Thanks for the great work in TeraStitcher! I'd like to know if it would be possible to stitch 2D RGB images using the command line tools. I'm able to do it using the GUI. However, I'm having trouble doing the same in the command line. I can run the pipeline just fine using the following:

terastitcher --import --projin="xml_import.xml" --imin_channel="G"
terastitcher --displcompute --projin="xml_import.xml" --imin_channel="G"
terastitcher --displproj --projin="xml_displcomp.xml" --imin_channel="G"
terastitcher --displthres --threshold=0.7 --projin="xml_displproj.xml" --imin_channel="G"
terastitcher --placetiles --projin="xml_displthres.xml" --imin_channel="G"
terastitcher --merge --projin="xml_merging.xml" --volout="output" --volout_plugin="TiledXY|3Dseries" --imout_format="tif" --imin_channel="G"

but if I try to use all color channels with --imin_channel="all" I get the error:

ERROR: in virtual iom::real_t *volumemanager::Stack::loadImageStack(int, int): conversion from multi-channel to intensity images not supported.

I'm running TeraStitcher standalone version 1.10.5 on MacOS El Capitan. I'd really appreciate some advice on how to stitch my color images.

Thank you!

I have the same experience with you and just now I found the solution to export RGB channels: In the last step, you download and 'cd' to a TeraStitcher-portable version('C:\Program Files\TeraStitcher-portable-1.11.6-win64' ), and use the terastitcher from that folder:

! terastitcher --merge --projin="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\xml_merging.xml" --volout="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\3" --volout_plugin="TiledXY|3Dseries" --imout_format="tif" --imin_channel="all"

then RGB image could be exported. But if you use the same TeraStitcher as previous steps, then errro appears: ERROR: in float *__cdecl volumemanager::Stack::loadImageStack(int,int) throw(class iomanager::exception): conversion from multi-channel to intensity images not supported.

rmd13 commented 5 years ago

Hi all,

Thanks for the great work in TeraStitcher! I'd like to know if it would be possible to stitch 2D RGB images using the command line tools. I'm able to do it using the GUI. However, I'm having trouble doing the same in the command line. I can run the pipeline just fine using the following:

terastitcher --import --projin="xml_import.xml" --imin_channel="G"
terastitcher --displcompute --projin="xml_import.xml" --imin_channel="G"
terastitcher --displproj --projin="xml_displcomp.xml" --imin_channel="G"
terastitcher --displthres --threshold=0.7 --projin="xml_displproj.xml" --imin_channel="G"
terastitcher --placetiles --projin="xml_displthres.xml" --imin_channel="G"
terastitcher --merge --projin="xml_merging.xml" --volout="output" --volout_plugin="TiledXY|3Dseries" --imout_format="tif" --imin_channel="G"

but if I try to use all color channels with --imin_channel="all" I get the error:

ERROR: in virtual iom::real_t *volumemanager::Stack::loadImageStack(int, int): conversion from multi-channel to intensity images not supported.

I'm running TeraStitcher standalone version 1.10.5 on MacOS El Capitan. I'd really appreciate some advice on how to stitch my color images.

Thank you!

You can also use teraConverter to do the last step. I also tried it and it also worked, the exported image are same as previous post. This is the command I use(in matlab commandline tool). When using teraConverter, I did not pass the parameter like --imin_channel="all" , however, I could still get RGB output images.

cd('C:\Program Files\TeraStitcher-portable-1.11.6-win64')
!teraconverter -s="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\xml_import.xml" -d="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\4" --sfmt="TIFF (unstitched, 3D)" --dfmt="TIFF (tiled, 3D)" 
ilykos commented 5 years ago
cd('C:\Program Files\TeraStitcher-portable-1.11.6-win64')
!teraconverter -s="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\xml_import.xml" -d="D:\QMDownload\6\[ok]MIRAX_mrsx\single_neuron_40X_3_extraxt\iHireMaster_1\iPageMaster_1\4" --sfmt="TIFF (unstitched, 3D)" --dfmt="TIFF (tiled, 3D)" 

Does this convert the output into RGB TIFF or keeps the it as a stack?