Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for the image_io sub-module #48

Merged
merged 10 commits into from
Mar 14, 2024
10 changes: 5 additions & 5 deletions brainglobe_utils/image_io/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def load_any(
Parameters
----------
src_path : str
Can be the path of a nifty file, tiff file, tiff files folder, or text
file containing a list of paths.
Can be the path of a nifty file, nrrd file, tiff file, tiff files
folder, or text file containing a list of paths.

x_scaling_factor : float, optional
The scaling of the brain along the x dimension (applied on loading
Expand Down Expand Up @@ -401,8 +401,7 @@ def load_image_series(
n_free_cpus=2,
):
"""
Load a brain from a sequence of files specified in a text file containing
an ordered list of paths.
Load a brain from a sequence of image paths.

Parameters
----------
Expand Down Expand Up @@ -601,7 +600,8 @@ def get_size_image_from_file_paths(file_path, file_extension="tif"):
Parameters
----------
file_path : str
File containing file_paths in a text file, or as a list.
Filepath of text file containing paths of all 2D files, or
filepath of a directory containing all 2D files.

file_extension : str, optional
Optional file extension (if a directory is passed).
Expand Down
8 changes: 4 additions & 4 deletions brainglobe_utils/image_io/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def to_nii(img, dest_path, scale=None, affine_transform=None):
A nifty image object or numpy array representing a brain.

dest_path : str
The path where to save the brain.
The file path where to save the brain.

scale : tuple of floats, optional
A tuple of floats to indicate the 'zooms' of the nifty image.
Expand Down Expand Up @@ -50,7 +50,7 @@ def to_tiff(img_volume, dest_path, photometric="minisblack"):
The image to be saved.

dest_path : str
Where to save the tiff stack.
The file path where to save the tiff stack.

photometric: str
Color space of image (to pass to tifffile.imwrite)
Expand All @@ -64,7 +64,7 @@ def to_tiffs(img_volume, path_prefix, path_suffix="", extension=".tif"):
"""
Save the image volume (numpy array) as a sequence of tiff planes.
Each plane will have a filepath of the following format:
pathprefix_zeroPaddedIndex_suffix.tif
{path_prefix}_{zeroPaddedIndex}{path_suffix}{extension}

Parameters
----------
Expand Down Expand Up @@ -100,7 +100,7 @@ def to_nrrd(img_volume, dest_path):
The image to be saved.

dest_path : str
Where to save the nrrd image.
The file path where to save the nrrd image.
"""
dest_path = str(dest_path)
nrrd.write(dest_path, img_volume)
Loading
Loading