Skip to main content

Utility for splitting large image files into slices or chunks

Project description

https://cmiclab.cs.ucl.ac.uk/GIFT-Surg/ImageSplit/raw/master/giftsurg-icon.png https://cmiclab.cs.ucl.ac.uk/GIFT-Surg/ImageSplit/badges/master/build.svg https://cmiclab.cs.ucl.ac.uk/GIFT-Surg/ImageSplit/badges/master/coverage.svg

ImageSplit is a utility for splitting very large image volumes into slices or multiple overlapping sub-volumes, and for recombining sub-volumes into a one or more volumes. ImageSplit can also convert the underlying data types.

ImageSplit is designed to prioritise low memory usage over performance, so that large volumes can be easily processed with limited memory resources.

Author: Tom Doel

ImageSplit was developed as part of the GIFT-Surg project, at the Translational Imaging Group (TIG) in the Centre for Medical Image Computing (CMIC) at University College London (UCL).

Usage

imagesplit.py [-h] -i INPUT [-o OUT] [-l OVERLAP] [-m MAX [MAX ...]] [-x STARTINDEX] [-t TYPE] [-f FORMAT] [-r [RESCALE [RESCALE ...]]] [-z [COMPRESS]] [-s SLICE] [-a AXIS [AXIS ...]] [--test]
warning:

ImageSplit will overwrite existing output files. Make sure you have your images backed up before you use this utility, to prevent accidental data loss.

Arguments:

Input and output filenames:

-i INPUT, --input INPUT

Name of input file, or filename prefix for a set of files

-o OUT, --out OUT

Name of output file, or filename prefix if more than one file is output

-x STARTINDEX, --startindex STARTINDEX

Start index for filename suffix when loading or saving a sequence of files

Specify how to split the image:

-l OVERLAP, --overlap OVERLAP

Number of voxels to overlap between output images. If not specified, output images will not overlap

-m MAX, --max MAX

Maximum number of voxels in each dimension in each output file. MAX can be a scalar or vector corresponding to each image dimension. The file will be optimally split such that each file output dimension is less than or equal to this maximum.

Specify file format, data type, and whether data should be rescaled (normalised):

-t TYPE, --type TYPE

Output data type (default: same as input file datatype)

-f FORMAT, --format FORMAT

Output file format such as mhd, tiff (default: same as input file format)

-r RESCALE, --rescale RESCALE

Rescale image between the specified min and max values. If no RESCALE values are specified, use the volume limits.

-z COMPRESS, --compress COMPRESS

Enables compression (default if -Z not specified: no compression). Valid values depend on the output file format. -z with no COMPRESS argument will choose a suitable compression for this file format. For TIFF files, the default is Adboe deflat and other valid values are those supported by PIL.

Specify output orientation:

-s SLICE, --slice SLICE

Divide image into slices along the specified axis. Choose 1, 2, 3 etc to select an axis relative to the current image orientation, or c, s, a to select an absolute orientation.This argument cannot be used with –axis, –max or –overlap.

-a AXIS, --axis AXIS

Axis ordering (default 1 2 3). Specifies the global axis corresponding to each dimension in the image file. The first value is the global axis represented by the first dimension in the file, and so on. One value for each dimension, dimensions are numbered 1,2,3,… and a negative value means that axis is flipped. This cannot be used with –slice

Help and testing:

--test

If set, no writing will be performed to the output files

-h, --help

Show this help message and exit

Contributing

Please see the contributing guidelines.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

ImageSplit-0.1.3-py2.py3-none-any.whl (38.8 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page