unravel.abca.merfish.merfish_cells_to_nii module#
Use abca_merfish_cells_to_nii
or mc
from UNRAVEL to convert ABCA MERFISH cells to a .nii.gz 3D image.
- Prereqs:
merfish_cluster
ormerfish_filter
to generate filtered cell data.
Usage:#
abca_merfish_cells_to_nii -i path/filtered_cells.csv -r path/to/reference.nii.gz [-b] [-o path/to/output.nii.gz] [-v]
- unravel.abca.merfish.merfish_cells_to_nii.merfish_cells_to_img(cell_df, img, xy_res, z_res)[source]#
Convert MERFISH cell metadata into a 3D image by marking voxel positions of cells.
- Parameters:
cell_df (pd.DataFrame) – DataFrame containing filtered cell metadata with reconstructed coordinates.
img (np.ndarray) – An empty 3D NumPy array shaped like the reference .nii.gz image.
xy_res (float) – Resolution of the x-y plane in microns (µm).
z_res (float) – Resolution of the z-plane in microns (µm).
- Returns:
A 3D image where cell positions are marked with 1.
- Return type:
np.ndarray