3.1.8. Option digitmed

3.1.8.1. Description

Medical image related tools (data mainly in DICOM or NIfTI protocol). For DICOM, Operations include regrouping and re-sorting slices, read meta information, link to other type of DICOM files and etc. In addition, measurement for images as feature extraction is also supported. For NIfTI image, the relation between pixel and voxel space requires computation. Dependencies of SimpltITK and pydicom are required.

Namespace of this module is mainly in info.toolbox.digitmed.rebuild. For convenience in practice, use main entry of info.med. As for the image reconstruction related functions, import the rebuild module from info.med.

DcmSetConstructor

load and re-organize a set of dicom slices in memory.

DcmSeries

build 3D image from a dicom series.

dcm_hierarchical_parser

parse keywords in dicom headers recursively.

dcm_attr_loader

generic attribute loader for dicom file.

dcm_constructor

rebuild dicom image(s) from a set of dicom slice files.

dcm_regroup

generate a cache for logging regrouped dicom files.

NIfTI

build 3D image from a NIfTI file.

nii_constructor

build 3D image(s) from NIfTI file(s).

While for other functional units, directly import from info.med.

radiomics_features

feature extraction automation.

vascular_invasion

vascular invasion angle evaluation.

3.1.8.2. Docstrings

class DcmSetConstructor

load and re-organize a set of dicom slices in memory.

Arguments:
Parameters:
  • data (Iterable[str]) – Iterable object composed of paths of dicom slices

  • loader (Literal['SimpleITK', 'pydicom']) – library as load engine; 'SimpleITK' as default

  • series_k (str) – keyword or tag for determining the same set of dicom slices; "0020|000e" as default

  • instance_k (str) – keyword or tag for determining the individual dicom slice instance; "0008|0018" as default

  • image_orientation_k (str) – keyword or tag of Image Orientation (Patient); "0020|0037" as default

  • pixel_spacing_k (str) – keyword or tag of Pixel Spacing; "0028|0030" as default

  • image_position_k (str) – keyword or tag of Image Position (Patient); "0020|0032" as default

  • spacing_between_slices_k (str) – keyword or tag of Spacing Between Slices; "0018|0088" as default

Variables:
  • ~stacking_axis (int) – index of stacking axis; 2 as default

  • ~verbosity (bool) – trigger for prompting message during data loading; False as default

  • ~user_defined_io (Callable[[str], ...]) – customized loader to transfer string of file path, to object in memory; None as default to use pydicom or SimpleITK automatically

Returns:

a DcmSetConstructor instance

Return type:

DcmSetConstructor

Property:
files:

list of original dicom slice paths.

files_set:

nested lists of re-organized dicom slice paths. paths attributed to the identical series were gathered into the same inner list.

loader:

engine for loading and meta information. SimpleITK and pydicom are supported.

headers:

header files using data loading engine mapped from files attribute.

dcm_set:

nested lists of re-organized header files. header files attributed to the identical series were gathered into the same inner list.

series_k:

keyword or tag for determining the same set of dicom slices. fetched from settings attribute.

instance_k:

keyword or tag for determining the individual dicom slice instance. fetched from settings attribute.

settings:

default settings for re-organizing.

stacking_axis:

index for stacking axis. determined by internal parameter ~stacking_axis.

Examples:
Code 3.149 re-organizing dicom slices
from info.med import rebuild as dcm
dcm_slices = ['./data/Image0_0.dcm', './data/Image0_1.dcm', ..., './data/Image0_154.dcm',
              './data/Image1_0.dcm', './data/Image1_1.dcm',  ..., './data/Image1_154.dcm']  # two dicom sets

res = dcm.DcmSetConstructor(data=dcm_slices)
print(res.dcm_set)  # [[dicom_set_of_image0], [dicom_set_of_image1]]
Logs:

Added in version 0.0.2.

Changed in version 0.0.4: support customized file loader via built-in argument ~user_defined_io, to enable dicom construction in distributed file system.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

class DcmSeries

build 3D image from a dicom series.

Arguments:
Parameters:
  • data (Iterable[str]) – Iterable object composed of paths of dicom slices

  • loader (Literal['SimpleITK', 'pydicom']) – library as load engine; 'SimpleITK' as default

  • series_k (str) – keyword or tag for determining the same set of dicom slices; "0020|000e" as default

  • instance_k (str) – keyword or tag for determining the individual dicom slice instance; "0008|0018" as default

  • image_orientation_k (str) – keyword or tag of Image Orientation (Patient); "0020|0037" as default

  • pixel_spacing_k (str) – keyword or tag of Pixel Spacing; "0028|0030" as default

  • image_position_k (str) – keyword or tag of Image Position (Patient); "0020|0032" as default

  • spacing_between_slices_k (str) – keyword or tag of Spacing Between Slices; "0018|0088" as default

  • axis_order (str) – combination of 'x', 'y' and 'z' to specify axis order; 'zyx' as default

  • template_meta (object) – get a meta information template; None for default

Variables:
  • ~is_sorted (bool) – trigger to escape sort step; True as default

  • ~stacking_axis (int) – index of stacking axis; 2 as default

  • ~verbosity (bool) – trigger for prompting message during data loading; False as default

Returns:

a DcmSeries instance

Return type:

DcmSeries

Property:
metas:

dict composed of header information for a set of dicom file series.

affine:

a \(\mathbb{R}^{4 \times 4}\) ndarray of affine matrix. affine describe the transformation from pixel to voxel space (see affine matrix).

rcs_spacing:

a \(\mathbb{R}^3\) ndarray of voxel spacing in order of _intrinsic_order attribute.

rcs_origin:

a \(\mathbb{R}^3\) ndarray of original location in order of _intrinsic_order attribute.

rcs_coordinates:

tuple composed of ndarray as coordinate in order of _intrinsic_order attribute.

rcs_array:

3-dimensional ndarray of image.

rcs_suv:

3-dimensional ndarray of standard uptake values built from image. applied exclusively in positron emission tomography (PET) modality.

affine_matrix:

the same as affine.

_intrinsic_order:

a certain combination of (0, 1, 2), determined by parameter axis_order. for example, the default axis_order used 'zyx' will result in intrinsic order of (2, 1, 0).

struct:

acquired attribute after linkage to struct file via link_struct.

dose:

acquired attribute after linkage to dose file via link_dose.

plan:

acquired attribute after linkage to plan file via link_plan.

Methods:
link_struct:

link object to current dicom series.

Variables:
  • data (str) – path-like string for struct file

  • roi_name_k (list[str]) – attribute keywords to visit roi names; ['StructureSetROISequence', 'ROIName'] as default

  • roi_number_k (list[str]) – attribute keywords to visit roi numbers; ['StructureSetROISequence', 'ROINumber'] as default

  • contour_sequence_k (list[str]) – attribute keywords to visit contour sequence; ['ROIContourSequence', 'ContourSequence'] as default

  • referenced_roi_number_k (list[str]) – attribute keywords to visit referenced roi numbers; ['ROIContourSequence', 'ReferencedROINumber'] as default

  • roi_name_map (Callable[[list[str]], list[ndarray]]) – callable object to map roi from name to ndarray; a SingleMap instance generated through previous arguments as default

roi_name_map:

acquired method after linking to struct file via link_struct. obtain the ROI ndarray from names.

Variables:

data (list[str]) – names for desired rois

Code 3.151 load rois after struct linkage
for roi in img.roi_name_map(['Spinal', 'Liver', 'Lung']):
    print(roi.shape)
link_dose:

link object to current dicom dose.

Variables:
  • data (str) – path-like string for dose file

  • grid_frame_offset_vector_k (Union[str, list[str]]) – attribute keywords to visit grid frame offset vector; "3004|000c" as default

  • dose_grid_scaling_k (Union[str, list[str]]) – attribute keywords to visit dose grid scaling; "3004|000e" as default

  • decomp_method (Literal['cp', 'tucker']) – decomposition method when applying resize for resampling; 'cp' or 'tucker' is available; 'tucker' as default

  • interp_method (Literal[...]) – interpolation method when applying resize; options are 'linear', 'nearest', 'nearest-up', 'zero', 'slinear', 'quadratic', 'cubic', 'previous', and 'next'; 'linear' as default

  • linspace_nums (int) – number of points to be generated for dose volume histogram; 100 as default

  • dvh_name_map (Callable[[Union[list[str], dict[str, ndarray]]], list[ndarray, ndarray]]) – callable object to map roi from name to dose volume histogram points in (x, y) pairs; before which the link_struct method must be activated; a SingleMap instance generated through previous argument as default

rcs_dose:

acquired attribute to obtain the dose ndarray calibrated via original image

dvh_name_map:

acquired method after linking to dose file via link_dose. obtain the DVH ndarray from names.

Variables:

data (list[str]) – names for desired rois

Code 3.153 load points after struct and dose linkage
from info.vis import visualization as vis
from info.basic.functions import dvh_res_to_vis

roi_names = ['CTV', 'Spinal', 'Eye']
dvh = img.dvh_name_map(data=roi_names)
vis.Canvas.play(data=dvh_res_to_vis(dvh),
                fig_configs=vis.FigConfigs.Line.update(name=roi_names, symbol=None,
                                                       pen=[_ for _ in 'rgb']),
                cvs_legend=True, cvs_left_label='Volume (%)', cvs_bottom_label='Dose (Gy)',
                cvs_title='Dose Volume Histogram (DVH)')

the corresponding dose volume histogram plot using Canvas to visualize will be like:

https://github.com/users/CubicZebra/projects/6/assets/34041412/9a7d4292-f97b-4733-9878-65036e62b2e4

Figure 3.14 dose volume histogram plot

link_plan:

under developing…

Examples:
Code 3.154 rebuild re-organized dicom slices
from info.med import rebuild as dcm
dcm_slices = ['./data/Image0_0.dcm', './data/Image0_1.dcm', ..., './data/Image0_154.dcm',
              './data/Image1_0.dcm', './data/Image1_1.dcm',  ..., './data/Image1_154.dcm']  # two dicom sets

res = dcm.DcmSetConstructor(data=dcm_slices)  # [[dicom_set_of_image0], [dicom_set_of_image1]]
for image_set in res.dcm_set:
    dcm.DcmSeries(data=image_set)
See also:
Logs:

Added in version 0.0.2.

Changed in version 0.0.3: support linkage to struct file, acquired attribute and roi_name_map method after linkage.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

dcm_hierarchical_parser

parse keywords in dicom headers recursively.

Arguments:
Parameters:

data (Union[str, Any]) – path-like str, the return from dcm_attr_loader, or Sequence instance from pydicom

Returns:

the parsed structure of keywords

Return type:

str

Examples:
Code 3.155 parse the structure of keywords in dicom
from info.me.rebuild import dcm_hierarchical_parser, dcm_attr_loader
file = "path/to/dcm/file.dcm"

dcm_hierarchical_parser(data=file)  # parse from a dicom file
# |--- AccessionNumber
# |--- BitsAllocated
# ...
# |--- ReferencedRTPlanSequence
# | |--- ReferencedFractionGroupSequence
# | | |--- ReferencedFractionGroupNumber
# | |--- ReferencedSOPClassUID
# | |--- ReferencedSOPInstanceUID
# |--- ReferringPhysicianName
# ...
# |--- StudyTime

plan_seq = dcm_attr_loader(data=file, attr_path="ReferencedRTPlanSequence")
dcm_hierarchical_parser(data=plan_seq)  # or parse from a dicom sequence
# |--- ReferencedFractionGroupSequence
# | |--- ReferencedFractionGroupNumber
# |--- ReferencedSOPClassUID
# |--- ReferencedSOPInstanceUID
Logs:

Added in version 0.0.3.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

dcm_attr_loader

generic attribute loader for dicom file. with attribute keyword, or list of keywords describing the hierarchical relationship, corresponding values can be obtained.

Arguments:
Parameters:
  • data (Union[str, object]) – path-like string for dicom file, or pydicom DataFileset object

  • attr_path (Union[str, list[str]]) – str for attribute, list of keywords for attribute path, or tuple of path list for multiple attributes reading

Returns:

values in dicom headers

Return type:

object

Raises:

TypeErrordata is not assigned properly

Examples:

Load attributes starting from a dicom file:

Code 3.156 dicom attribute loading pipeline from file
from info.med import rebuild as dcm
file = "/path/to/dicom/file.dcm"

# get referenced SOP instance UID via str assignment:
uid = dcm.dcm_attr_loader(data=file, attr_path='ReferencedSOPInstanceUID')

# get referenced fraction group number inside structured sequence, via list of keywords assignment:
_path = ['ReferencedRTPlanSequence', 'ReferencedFractionGroupSequence', 'ReferencedFractionGroupNumber']
group_num = dcm.dcm_attr_loader(data=file, attr_path=_path)

# get multiple attributes, via tuple composed of keyword paths
_paths = (['ReferencedSOPInstanceUID'],
          ['ReferencedRTPlanSequence', 'ReferencedFractionGroupSequence', 'ReferencedFractionGroupNumber'])
uid, group_num = dcm.dcm_attr_loader(data=file, attr_path=_paths)

Or load attributes, from the return of dcm_attr_loader self. This property is expected to be used in the circumstance of existing complicated parallel structure in parent attributes.

Code 3.157 dicom attribute loading pipeline from self return
_path_parent = ['ReferencedRTPlanSequence', 'ReferencedFractionGroupSequence']  # paralleled sequences here
_path_sub = ['ReferencedFractionGroupNumber']

for sequence in dcm.dcm_attr_loader(data=file, attr_path=_path_parent):
    group_num = dcm.dcm_attr_loader(data=sequence, attr_path=_path_sub)
Notes:

pydicom styled attribute path is supported exclusively, due to its stable capability to parse header.

Logs:

Added in version 0.0.3.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

dcm_constructor

rebuild dicom image(s) from a set of dicom slice files.

Arguments:
Parameters:
  • data (Iterable[str]) – Iterable object composed of paths of dicom slices

  • loader (Literal['SimpleITK', 'pydicom']) – library as load engine; 'SimpleITK' as default

  • series_k (str) – keyword or tag for determining the same set of dicom slices; "0020|000e" as default

  • instance_k (str) – keyword or tag for determining the individual dicom slice instance; "0008|0018" as default

  • image_orientation_k (str) – keyword or tag of Image Orientation (Patient); "0020|0037" as default

  • pixel_spacing_k (str) – keyword or tag of Pixel Spacing; "0028|0030" as default

  • image_position_k (str) – keyword or tag of Image Position (Patient); "0020|0032" as default

  • spacing_between_slices_k (str) – keyword or tag of Spacing Between Slices; "0018|0088" as default

  • axis_order (str) – combination of 'x', 'y' and 'z' to specify axis order; 'zyx' as default

Variables:
  • ~use_template_meta (bool) – whether save a template meta via pydicom for each DcmSeries; True will use headers in the first slice as example meta; False as default

  • ~user_defined_io (Callable[[str], ...]) – customized loader to transfer string of file path, to object in memory; None as default to use pydicom or SimpleITK automatically

Returns:

a list composed of DcmSeries instance

Return type:

list[DcmSeries]

Raises:

TypeErrordata is not assigned properly

Examples:
Code 3.158 dicom image rebuilding pipeline
from info.med import rebuild as dcm
dcm_slices = ['./data/Image0_0.dcm', './data/Image0_1.dcm', ..., './data/Image0_154.dcm',
              './data/Image1_0.dcm', './data/Image1_1.dcm',  ..., './data/Image1_154.dcm']  # two dicom sets

# use default SimpleITK loader
imgs = dcm.dcm_constructor(data=dcm_slices)

# or use pydicom loader
imgs = dcm.dcm_constructor(data=dcm_slices, **dcm.pydicom_config)

for img in imgs:
    print(img.metas)
See also:
Logs:

Added in version 0.0.2.

Changed in version 0.0.4: support customized file loader via built-in argument ~user_defined_io, to enable dicom construction in distributed file system.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

dcm_regroup

generate a cache for logging regrouped dicom files.

Arguments:
Parameters:
  • data (Generator) – generator for dicom files to be integrated

  • regroup_reference (list[str]) – list of tags using for regrouping; tag from first to last refers the hierarchical structure from root to leaf in regrouped reference

  • loader (Literal['SimpleITK', 'pydicom']) – loader engine for dicom files; 'SimpleITK' or 'pydicom' is acceptable; 'SimpleTIK' as default

  • rearrange (bool) – whether rearrange dicom files with pre-defined loader engine; if False, regrouped dicom-like files will be rearranged by file names in a simple list, otherwise in a nested list composed of file names rearranged by their stacking axis locations, defined intrinsically in the data loading engine; True as default

  • dump_as (str) – file name for saving regroup file reference; '_regroup_refs' as default to generate a _regroup_refs.pyp file in work directory

Variables:
  • ~verbosity (bool) – trigger for prompting message during data processing and loading; False as default

  • ~user_defined_io (Callable[[str], ...]) – customized loader to transfer string of file path, to object in memory; None as default to use pydicom or SimpleITK automatically

Returns:

dict composed of basic settings of regrouping, and regroup files reference

Return type:

dict

Examples:
Code 3.159 regroup dicom files
from info.med import rebuild as dcm
from info.me import io

gen = io.search_from_root(data=r"path/to/dicom/folder", search_condition=lambda x: x[-3:] == 'dcm')

res = dcm.dcm_regroup(data=gen, regroup_reference=["0020|000e"])
res['regroup_result']
# {'uid_1': [[dicom_series_1, ...]],
#  'uid_2': [[dicom_series_2, ...]],
#  ...
#  'uid_n': [[dicom_series_n, ...]]}

res = dcm.dcm_regroup(data=gen, regroup_reference=["0010|0010"])
res['regroup_result']
# {'patient_1': [[dicom_series_1, ...]],
#  'patient_2': [[dicom_series_2, ...]],
#  ...
#  'patient_n': [[dicom_series_n, ...]]}

res = dcm.dcm_regroup(data=gen, regroup_reference=["0010|0010", "0020|000e"])
res['regroup_result']
# {'patient_1': {'uid_1': [[dicom_series_1, ...]], ..., 'uid_m1': [[dicom_series_m1, ...]]},
#  'patient_2': {'uid_1': [[dicom_series_1, ...]], ..., 'uid_m2': [[dicom_series_m2, ...]]},
#  ...
#  'patient_n': {'uid_1': [[dicom_series_1, ...]], ..., 'uid_mn': [[dicom_series_mn, ...]]}}
Notes:

When rearrange is True, this function will call DcmSetConstructor using loader as data loading engine. In this condition, arguments can be passed into DcmSetConstructor (like the ~verbosity does).

See also:
Logs:

Added in version 0.0.4.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

class NIfTI

build 3D image from a NIfTI file.

Arguments:
Parameters:
  • data (str) – path of nii or nii.gz NIfTI file

  • preprocess_meta (Optional[Callable[[str, str], Any]]) – callable object to preprocess header information, should be capable to convert keyword and value pairs, into accessible data type in Python; default uses a built-in function

  • axis_order (str) – combination of 'x', 'y' and 'z' to specify axis order; 'zyx' as default

Returns:

NIfTI image

Return type:

NIfTI

Property:
metas:

dict composed of header information for NIfTI image.

affine:

a \(\mathbb{R}^{4 \times 4}\) ndarray of affine matrix. affine describe the transformation from pixel to a relative, or absolute voxel space (see NIfTI-1 Data Format).

rcs_spacing:

a \(\mathbb{R}^3\) ndarray of voxel spacing in order of _intrinsic_order attribute.

rcs_origin:

a \(\mathbb{R}^3\) ndarray of original location in order of _intrinsic_order attribute.

rcs_coordinates:

tuple composed of ndarray as coordinate in order of _intrinsic_order attribute.

rcs_array:

3-dimensional ndarray of image.

rcs_suv:

3-dimensional ndarray of standard uptake values built from image. applied exclusively in positron emission tomography (PET) modality.

affine_matrix:

the same as affine.

_intrinsic_order:

a certain combination of (0, 1, 2), determined by parameter axis_order. for example, the default axis_order used 'zyx' will result in intrinsic order of (2, 1, 0).

Examples:
Code 3.160 rebuild a NIfTI image
from info.med import rebuild as nii
nii_file = './data/image.nii'
img = nii.NIfTI(data=nii_file)
print(img.rcs_array.shape, img.rcs_spacing, img.rcs_origin)
See also:
Logs:

Added in version 0.0.5.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

nii_constructor

build 3D image(s) from NIfTI file(s).

Arguments:
Parameters:
  • data (Union[str, list[str]]) – path, or list of paths of nii or nii.gz NIfTI file

  • preprocess_meta (Optional[Callable[[str, str], Any]]) – callable object to preprocess header information, should be capable to convert keyword and value pairs, into accessible data type in Python; default uses a built-in function

  • axis_order (str) – combination of 'x', 'y' and 'z' to specify axis order; 'zyx' as default

Variables:

~user_defined_io (Callable[[str], ...]) – customized loader to transfer string of file path, to object in memory; None as default to use SimpleITK automatically

Returns:

NIfTI image(s)

Return type:

Union[NIfTI, list[NIfTI]]

Examples:
Code 3.161 rebuild NIfTI images
from info.med import rebuild as nii
nii_files = ['./data/image0.nii', './data/image1.nii', ..., './data/image100.nii']

img_12 = nii.nii_constructor(data=nii_files[1:3])  # if not too much images
imgs = (nii.nii_constructor(data=_) for _ in nii_files)  # or mapping for all via generator
See also:
Logs:

Added in version 0.0.5.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

radiomics_features

feature extraction automation. this function requires the readiness of a configured pyradiomics environment.

Arguments:
Parameters:
  • data (Generator) – generator to yield case name, ndarray image, ndarray segmentation, spacing

  • extractor_setting (Optional[dict]) – parameters passed on radiomics extractor when initiation; empty dict {} as default to use default setting

  • err_file (Optional[str]) – log to note down exceptive case; None as default to use ‘err_case.log’ inplace, if any exceptive case captured during extraction

  • image_types (Optional[dict[str, dict]]) – parameters use image type as keyword to specify desired modality; value should be extraction setting during extraction, empty dict for using default setting; None as default to apply all image types

  • feature_class (Optional[dict[str, Optional[list[str]]]]) – customize selection features from sub feature class; keyword should be valid name of sub feature class, and the value is list composed of desired feature names; value can be None, or empty list [] to enable all features of that modality; None as default, for not applying customized feature selection

Returns:

table uses case names as indexing, and feature names as column names

Return type:

DataFrame

Examples:
Code 3.162 radiomic feature extraction implementation
from info.med import radiomics_features

def gen():
    for img in imgs:
        for roi in img.rois:
            yield str(img.name+roi.name), img, roi, img.spacing

res = radiomics_features(data=gen())
res.to_csv('result.csv', encoding='utf-8-sig')
Notes:

Default installation might result in no valid export for certain feature classes. If all features are desired, in case, ensure that PyWavelets, trimesh and scikit-image are installed in the environment.

The dependent pyradiomics package raises some unaddressed build issues in Python greater than 3.9 until now Aug 4, 2024. Recreate a downgraded Python (\(\leq\) 3.9) environment if necessary, otherwise await for the bugs-fixing from develop team of pyradiomics.

Incompatibility of some dependencies might raise due to numpy with version greater than 2.0.0.; Further test is required. If unknown error has been raised, try to downgrade numpy.

Logs:

Added in version 0.0.3.

Changed in version 0.0.4:

remove pyradiomics from dependencies due to its unaddressed issues from source code building and no support for up-to-date Python version among its binary releases.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06

vascular_invasion

vascular invasion angle evaluation.

Arguments:
Parameters:
  • data (tuple[ndarray, ndarray]) – tuple contained vascular and tumor masks

  • in_spacing (Iterable[Numeric]) – spacing for each dimension in the unit voxel; None as default for using 1 on each dimension

  • scope_radius (Numeric) – radius of scope to make constraint on mask of vessel, to determine the center point of vessel; None as default to automatically calculate the vector from the mass center of overlapped region, to the geometric center of tumor as its radius

Variables:

~differential_tolerance (int) – positive integer used as differential operator to evaluate the status of penetration; 3 as default

Returns:

1-length dict with boolean keyword as referred to whether was invaded, while value as represented for the spatial distance if no-connection; radian angle if invaded. If a list of numerical numbers was calculated, it is the set of radian angles for multiple invasion regions.

Return type:

dict[bool, Union[Numeric, list[Numeric]]]

Examples:
Code 3.163 evaluation on vascular invasion state
from info.med import vascular_invasion
tumor, vessel, spacing = ...
res = vascular_invasion(data=(tumor, vessel), in_spacing=spacing)
Notes:

Implemented via dimension-irrelevant paradigm, with compatibility for tensor in 2-rank or higher.

No warranty in precision and efficiency for calculation on 3-dimensional case currently. This issue will be addressed in next official release.

Logs:

Added in version 0.0.5: Scheme determination and clinical validation are conducted by Yajiao Zhang and Haoran Zhang.

– Created by Chen Zhang; Last updated on 01:34, 2025-09-06


Authors:

Chen Zhang

Version:

0.0.5

Created on:

Jun 29, 2023