-
Notifications
You must be signed in to change notification settings - Fork 1
slideMacro
slideMacro
is designed to extract macro images from whole-slide image (WSI) files (e.g., *.TIF
, *.ndpi
) in .png
-format. It allows users to specify the magnification level and additional options for displaying, saving, and handling the output.
Two versions are available:
- This is a
bash
implementation. - This is a
python3
implementation which is much faster than thebash
version.
Supported formats
- TIFF
- Aperio
- Hamamatsu
- iScan
- iScanHT
- Leica
The bash
version is using ImageMagick.
Examples:
-
Setting the file:
./slideMacro -f "file.TIF"
-
Setting the macro suffix:
./slideMacro --file="file.TIF" --macrosuffix=".layer5"
-
Forcing a specific layer:
./slideMacro --file="file.TIF" -l 3
-
Setting additional convert arguments:
./slideMacro --file="file.TIF" --convert-args='-resize 300x300 -rotate 90'
-
Ignoring dependencies:
./slideMacro --file="file.TIF" --ignore-dependencies
-
Displaying help:
./slideMacro --help
-
Displaying version information:
./slideMacro --version
Job list examples:
- Print a job list
find "$(pwd)" -iname "*.TIF" -printf 'slideMacro is processing file [ %p ].\n' -exec $(command -v "$SCRIPTNAME") --file "{}" \;
- Print a job list for SLURM
find "$(pwd)" -iname "*.TIF" -type f \
-exec printf "sbatch $DEFAULT_SLURMARGS --chdir=\"$(pwd)/\" " \; \
-exec printf "$(command -v "$SCRIPTNAME") " \; \
-exec echo "--file=\"{}\"" \;
Argument(s):
-
-f, --file <filename>
- Specifies the virtual slide file to create a mask from.
Optional argument(s):
-
--macrosuffix <text>
- Sets the macro suffix. The default is
".macro"
.
- Sets the macro suffix. The default is
-
-l, --layer <integer>
- Forces a specific layer by layer id.
-
--convert-args='<arguments>'
- Sets convert arguments (use '=' sign and quotes).
-
--ignore-dependencies
- Ignores missing dependencies but gives a warning.
-
--help
- Displays the help message.
-
--version
- Displays version and license information.
Dependencies
convert
Example usage:
python slideMacro.py --input AE1234.SR.ndpi
Argument(s):
-
-i
,--input
- Specifies the input, which can be either a single image file, a directory containing files, or a wildcard pattern (e.g.,
*.ndpi
). Required.
- Specifies the input, which can be either a single image file, a directory containing files, or a wildcard pattern (e.g.,
-
-l
,--levels
- Magnification level to extract, with '6' as level 6. Try: 6. Required.
Optional argument(s):
-
-o
,--outdir
- Output dir, default is present working directory. Optional.
-
-s
,--suffix
- Suffix to append to end of file, default is 'm' for thumbnail and '#' for a given level. Optional.
-
-t
,--type
- Output file type, default is png (which is slower), other options are tif. Optional.
-
-f
,--force
- Force output even if it exists. Optional.
-
-v
,--verbose
- While writing images also display image properties. Optional.
-
-h
,--help
- Show this help message and exit. Optional.
Licence. The MIT License (MIT): http://opensource.org/licenses/MIT.
Copyright (c) 2014-2024, Bas G.L. Nelissen & Sander W. van der Laan, UMC Utrecht, Utrecht, the Netherlands.
Introduction
General instructions
slide2Tiles
slideAppend.sh
slideAppendGCT.sh
slideConvert
slideDirectory
slideDupIdentify.py
slideEMask
slideEntropySegmentation.py
slideExtract.py
slideExtractTiles.py
slideInfo
slideInfo.py
slideJobChecker
slideLookup
slideMacro
slideMacro.py
slideMask
slideMoveNewWSI.py
slideNormalize
slideRename
slideRename.py
slideThumb
slideThumb.py
slideQuantify_v1
slideQuantify_v1_1_expresshist_mask.sh
slideQuantify_v1_2_expresshist_tile.sh
slideQuantify_v1_3_tile_normalizing.sh
slideQuantify_v1_4_cellprofiler.sh
slideQuantify_v1_5_wrapup.sh
slideQuantify_v2
slideQuantify_v2_1_entropy_segmentation.sh
slideQuantify_v2_2_extract_tiles.sh
slideQuantify_v2_3_tile_normalizing.sh
slideQuantify_v2_4_cellprofiler.sh
slideQuantify_v2_5_wrapup.sh
slideQuantifyOSX
slideQuantify_cellprofiler.sh
slideQuantify_mask.sh
slideQuantify_normalizing.sh
slideQuantify_tiling.sh
slideQuantify_wrapup.sh
Conda version (default/preferred)
Homebrew version
Rocky 8 Conda version (default/preferred)
Ubuntu 16.04 LTS
Ubuntu 12.04
CentOS7 Conda version with modules
Administrator version