fiji / Stitching

Fiji's Stitching plugins reconstruct big images from tiled input images.
http://imagej.net/Stitching
GNU General Public License v2.0
96 stars 64 forks source link

stripe artifacts with "write to disk" #39

Closed schmiedc closed 2 years ago

schmiedc commented 8 years ago

Hi,

I am running the Grid/Collection stitching plugin on a dataset with 3 channels. When running the plugin with "write to disk" I get stripe artifacts. writetodisk

However when I run it with "Fuse and display" these stripes are not visible. fuseanddisplay

This is the macro I am running:

run("Grid/Collection stitching", "type=[Positions from file] " +
        "order=[Defined by image metadata] " +
        "multi_series_file=" + dir + IJ.pad(filedir, 4) + File.separator + IJ.pad(filedir, 4) + "-"  + file + ".czi " +
        "fusion_method=[Linear Blending] regression_threshold=0.35 max/avg_displacement_threshold=2.50 " +
        "absolute_displacement_threshold=3.50 compute_overlap increase_overlap=0 " +
        "subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] " +
        //"image_output=[Fuse and display]");
        "image_output=[Write to disk] output_directory=[" + fileoutput + "]");

Fiji and ImageJ are up to date. I run it on ubuntu 16.04.

Cheers, Christopher

imagejan commented 2 years ago

@schmiedc @ctrueden is this still the case? People are using image_output=[Write to disk] in various examples, see e.g. https://github.com/uw-loci/automatic-histology-registration-pyimagej/blob/8ad405170ec46dccbdc1c20fbbeb6eaff47b8b76/pseudo_modality.ipynb and https://github.com/imagej/pyimagej/pull/192.

If the outputs of image_output=[Fuse and display] and image_output=[Write to disk] differ, we should warn and recommend using the Fusion.fuse API directly where possible.

ctrueden commented 2 years ago

@imagejan I'm sorry, I don't know.

@binli123 Heads up: your workflows that use the Grid/Collection stitching's "Write to disk" feature might be writing out suboptimal data, compared to using "Fuse and display" in memory. Would it be easy for you to check this?

binli123 commented 2 years ago

I checked some recent stitching results obtained using this plugin with the Write to disk option via PyImagJ. They do not seem to have this artifact.

Single channel multiphoton:

image

A brighter example:

image

RGB image:

image The yellow box marks the boundary of a tile. The same image from the first example stitched with the the Fuse to display option in ImageJ: image

Overall the transition between boundaries looks quite smooth.

A snippet of the code I used:

    params = {'type': 'Positions from file', 'order': 'Defined by TileConfiguration', 
            'directory':stitch_folder, 'ayout_file': 'TileConfiguration.txt', 
            'fusion_method': 'Linear Blending', 'regression_threshold': '0.30', 
            'max/avg_displacement_threshold':'2.50', 'absolute_displacement_threshold': '3.50', 
            'compute_overlap':False, 'computation_parameters': 'Save computation time (but use more RAM)', 
            'image_output': 'Write to disk', 'output_directory': temp_channel_folder}
    plugin = "Grid/Collection stitching"
    ij.py.run_plugin(plugin, params)
ctrueden commented 2 years ago

Great, thanks @binli123! I will close this then. We can reopen if anyone has a recipe to reproduce with the latest version.