unravel.register.reg_prep module#
Use reg_prep
(rp
) from UNRAVEL to load a full resolution autofluo image and resamples to a lower resolution for registration.
- Input examples (path is relative to ./sample??; 1st glob match processed):
*.czi, autofluo/*.tif series, autofluo, *.tif, or *.h5
- Outputs:
./sample??/reg_inputs/autofl_`*`um.nii.gz ./sample??/reg_inputs/autofl_`*`um_tifs/*.tif series (used for training ilastik for
seg_brain_mask
)
Note
If -d is not provided, the current directory is used to search for sample?? dirs to process.
If the current dir is a sample?? dir, it will be processed.
If -d is provided, the specified dirs and/or dirs containing sample?? dirs will be processed.
If -p is not provided, the default pattern for dirs to process is ‘sample??’.
- Next command:
seg_copy_tifs
forseg_brain_mask
orreg
Usage:#
reg_prep -i *.czi [-md path/metadata.txt] [For .czi: –channel 0] [-o reg_inputs/autofl_50um.nii.gz] [–reg_res 50] [–zoom_order 0] [–miracl] [-d list of paths] [-p sample??] [-v]
- unravel.register.reg_prep.reg_prep(ndarray, xy_res, z_res, reg_res, zoom_order, miracl)[source]#
Prepare the autofluo image for
reg
or mimic preprocessing forvstats_prep
.- Parameters:
ndarray (-) – full res 3D autofluo image.
xy_res (-) – x/y resolution in microns of ndarray.
z_res (-) – z resolution in microns of ndarray.
reg_res (-) – Resample input to this resolution in microns for
reg
.zoom_order (-) – Order for resampling (scipy.ndimage.zoom).
miracl (-) – Include reorientation step to mimic MIRACL’s tif to .nii.gz conversion.
- Returns:
Resampled image.
- Return type:
img_resampled (np.ndarray)