@@ -521,46 +521,45 @@ def save_image_with_extension(
521
521
imp : ij.ImagePlus
522
522
ImagePlus object to save.
523
523
extension : {'ImageJ-TIF', 'ICS-1', 'ICS-2', 'OME-TIFF', 'CellH5', 'BMP'}
524
- Output format to use:
525
- - ImageJ-TIF: Saves as ImageJ TIFF format (.tif)
526
- - ICS-1: Saves as ICS version 1 format (.ids)
527
- - ICS-2: Saves as ICS version 2 format (.ics)
528
- - OME-TIFF: Saves as OME-TIFF format (.ome.tif)
529
- - CellH5: Saves as CellH5 format (.ch5)
530
- - BMP: Saves as BMP format (one file per slice)
524
+ Output format to use, see Notes section below for details.
531
525
out_dir : str
532
526
Directory path where the image(s) will be saved.
533
527
series : int
534
528
Series number to append to the filename.
535
529
pad_number : int
536
530
Number of digits to use when zero-padding the series number.
537
531
split_channels : bool
538
- If True, splits channels and saves them individually in separate folders
539
- named "C1", "C2", etc. inside out_dir. If False, saves all channels in a
532
+ If True, split channels and save them individually in separate folders
533
+ named "C1", "C2", etc. inside out_dir. If False, save all channels in a
540
534
single file.
541
535
542
536
Notes
543
537
-----
544
- - For "ImageJ-TIF" format, uses IJ.saveAs function
545
- - For "BMP" format, saves images using StackWriter.save with one BMP file
546
- per slice in a subfolder named after the original image
547
- - For all other formats, uses Bio-Formats exporter (bf.export)
548
- - The original ImagePlus is not modified, but any duplicate images created
549
- for channel splitting are closed after saving
550
- - Metadata is preserved when using Bio-Formats exporters
538
+ Depending on the value of the `extension` parameter, one of the following
539
+ output formats and saving strategies will be used:
540
+ - Bio-Formats based formats will be produced by calling `bf.export()`, note
541
+ that these formats will preserve metadata (which is **not** the case for
542
+ the other formats using different saving strategies):
543
+ - `ICS-1`: Save as ICS version 1 format (a pair of `.ics` and `.ids`).
544
+ - `ICS-2`: Save as ICS version 2 format (single `.ics` file).
545
+ - `OME-TIFF`: Save in OME-TIFF format (`.ome.tif`).
546
+ - `CellH5`: Save as CellH5 format (`.ch5`).
547
+ - `ImageJ-TIF`: Save in ImageJ TIFF format (`.tif`) using `IJ.saveAs()`.
548
+ - `BMP`: Save in BMP format using `StackWriter.save()`, producing one `.bmp`
549
+ per slice in a subfolder named after the original image.
551
550
552
551
Examples
553
552
--------
554
553
Save a multichannel image as OME-TIFF without splitting channels:
555
554
556
555
>>> save_image_with_extension(imp, "OME-TIFF", "/output/path", 1, 3, False)
557
- # Saves as : /output/path/image_title_series_001.ome.tif
556
+ # resulting file : /output/path/image_title_series_001.ome.tif
558
557
559
- Save with channels split :
558
+ Save with channel splitting :
560
559
561
560
>>> save_image_with_extension(imp, "OME-TIFF", "/output/path", 1, 3, True)
562
- # Saves as : /output/path/C1/image_title_series_001.ome.tif
563
- # /output/path/C2/image_title_series_001.ome.tif
561
+ # resulting files : /output/path/C1/image_title_series_001.ome.tif
562
+ # /output/path/C2/image_title_series_001.ome.tif
564
563
"""
565
564
566
565
out_ext = {}
0 commit comments