A library to split and merge high-resolution 3D images. Currently supports nii format only.
- Python 2.7.5
- Numpy 1.12.1
- Nibabel
import imageutils as iu
img = iu.ImageUtils(filepath="/path/to/image.nii")
img.split(first_dim=5, second_dim=5, third_dim=5, local_dir="/path/to/output_dir", filename_prefix="bigbrain")
# mem = 12g
import imageutils as iu
img = iu.ImageUtils(filepath="/path/to/image.nii")
img.split_multiple_writes(Y_splits=5, Z_splits=5, X_splits=5, out_dir="/path/to/output_dir", mem=12*1024**3, filename_prefix="bigbrain",
extension="nii")
import imageutils as iu
import numpy as np
img = iu.ImageUtils(reconstructed="/path/to/img.nii", first_dim=3850, second_dim=3025, third_dim=3500, dtype=np.uint16)
img.reconstruct_img(legend="/path/to/legend", "clustered", mem=0)
- cluster reads strategy
# mem=12g
import imageutils as iu
import numpy as np
img = iu.ImageUtils(reconstructed="/path/to/img.nii", first_dim=3850, second_dim=3025, third_dim=3500, dtype=np.uint16)
img.reconstruct_img(legend="/path/to/legend", "clustered", mem=12*1024**3)
- multiple reads strategy
# mem=12g
import imageutils as iu
import numpy as np
img = iu.ImageUtils(reconstructed="/path/to/img.nii", first_dim=3850, second_dim=3025, third_dim=3500, dtype=np.uint16)
img.reconstruct_img(legend="/path/to/legend", "multiple", mem=12*1024**3)
This project is licensed under the MIT License - see the LICENSE file for details