unravel.image_tools.atlas.wireframe module#
Use atlas_wireframe
(wf
) from UNRAVEL to generate a thin wireframe image from an atlas NIfTI file.
- Outputs:
path/atlas_img_W.nii.gz (Wireframe image)
path/atlas_img_W_IDs.nii.gz (Wireframe image with region IDs)
Note
Outlines are generated outside the regions and not inside smaller regions.
For regions at the surface of the brain, the outlines are internalized.
Usage:#
atlas_wireframe -i path.atlas.nii.gz [-wo path/atlas_img_W.nii.gz] [-id path/atlas_img_W_IDs.nii.gz] [-v]
- unravel.image_tools.atlas.wireframe.process_intensity(args)[source]#
Process a single intensity: generate its binary mask, dilate, and find boundaries.
- Parameters:
args (tuple) – A tuple containing the ndarray and the intensity value.
- Returns a tuple with:
binary_mask (np.ndarray): A binary mask for the given intensity. boundary (np.ndarray): A binary boundary mask for the given intensity
- unravel.image_tools.atlas.wireframe.generate_wireframe(atlas_ndarray, unique_intensities)[source]#
Generate a wireframe image of an atlas NIfTI file where outlines are outside the regions and not inside smaller regions.
- Parameters:
atlas_ndarray (np.ndarray) – A 3D numpy array of an atlas NIfTI file.
unique_intensities (np.ndarray) – A list of unique intensity values in the atlas ndarray (sorted from smallest to largest regions)
- Returns:
A binary wireframe image (1 = wireframe, 0 = background; uint8) wireframe_image_IDs (np.ndarray): A wireframe image with region IDs (uint16)
- Return type:
wireframe_image (np.ndarray)