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??/parameters/metadata.txt (if missing)
./sample??/reg_inputs/autofl_`*`um.nii.gz
./sample??/reg_inputs/autofl_`*`um_tifs/*.tif series (used for training ilastik for
seg_brain_mask)
Note
To quickly specify -x and -z with a tif series input, first run
io_metadatato save metadata.txt files in each sample?? dir.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??’.
This assumes that images are 16 bit. We can add an option for other bit depths if needed.
- Next command:
seg_copy_tifsforseg_brain_maskorreg
Usage:#
reg_prep -i *.czi [-md path/metadata.txt] [-x 3.5232] [-z 6] [-c 0] [-o reg_inputs/autofl_50um.nii.gz] [-r 50] [-zo 1] [-mi] [-d space-separated list of paths] [-p pattern] [-v]
- unravel.register.reg_prep.reg_prep(ndarray, xy_res, z_res, reg_res, zoom_order, miracl)[source]#
Prepare the autofluo image for
regor 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)