nireports.reportlets.utils module¶
Helper tools for visualization purposes.
- nireports.reportlets.utils.combine_svg(svg_list: list[str], axis='vertical') SVGFigure[source]¶
Composes the input svgs into one standalone svg
- nireports.reportlets.utils.compose_view(bg_svgs: list[SVGFigure], fg_svgs: list[SVGFigure], ref: int = 0, out_file: str | PathLike[str] = 'report.svg') str[source]¶
Compose svgs into one standalone svg with CSS flickering animation.
- Parameters:
- Returns:
out_file
- Return type:
same as input
- nireports.reportlets.utils.cuts_from_bbox(mask_nii: SpatialImage, cuts: int = 3) dict[str, list[float]][source]¶
Find equi-spaced cuts for presenting images.
- nireports.reportlets.utils.extract_svg(display_object: DisplayObject, dpi: int = 300, compress: bool | Literal['auto'] = 'auto') str[source]¶
Remove the preamble of the svg files generated with nilearn.
- nireports.reportlets.utils.get_parula() LinearSegmentedColormap[source]¶
Generate a ‘parula’ colormap.
- nireports.reportlets.utils.robust_set_limits(data: ndarray[tuple[Any, ...], dtype[_ScalarT]], plot_params: dict[str, Any], percentiles: tuple[float, float] = (15, 99.8)) dict[str, Any][source]¶
Set (vmax, vmin) based on percentiles of the data.
- nireports.reportlets.utils.svg2str(display_object: DisplayObject, dpi: int = 300) str[source]¶
Serialize a nilearn display object to string.