Skip to content

Commit

Permalink
Rename categories of attributes to be more accurate and generic
Browse files Browse the repository at this point in the history
Name changes:
- clinical -> tabular
- image - > time-series
  • Loading branch information
nathanpainchaud committed Nov 10, 2023
1 parent f0a4853 commit 5a08b22
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 235 deletions.
18 changes: 9 additions & 9 deletions didactic/data/cardinal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pandas as pd
from vital.data.cardinal.config import CardinalTag, ImageAttribute
from vital.data.cardinal.config import CardinalTag, TimeSeriesAttribute
from vital.data.cardinal.config import View as ViewEnum
from vital.data.cardinal.utils.attributes import build_attributes_dataframe
from vital.data.cardinal.utils.data_struct import Patient
Expand Down Expand Up @@ -107,25 +107,25 @@ def _to_num(attr_data: pd.Series) -> pd.Series:
return neigh_data


def build_img_attr_by_patient_group_dataframe(
def build_time_series_attr_by_patient_group_dataframe(
patients_groups: Mapping[Hashable, Iterable[Patient]],
attr: Tuple[ViewEnum, ImageAttribute],
attr: Tuple[ViewEnum, TimeSeriesAttribute],
group_desc: str = "group",
mask_tag: str = CardinalTag.mask,
resampling_rate: int = 128,
) -> pd.DataFrame:
"""Builds a dataframe with the average curve of an image attribute by patient group.
"""Builds a dataframe with the average curve of a time-series attribute by patient group.
Args:
patients_groups: Mapping between group ID and the patients in that group.
attr: A pair of view and image attribute to compute the average curve of.
attr: A pair of view and time-series attribute to compute the average curve of.
group_desc: Description of the semantic meaning of the groups.
mask_tag: Tag of the segmentation mask for which to extract the image attribute data.
resampling_rate: Number of points at which to resample the image attribute curves from each patient, so that
they can be easily compared and aggregated together.
mask_tag: Tag of the segmentation mask for which to extract the time-series attribute data.
resampling_rate: Number of points at which to resample the time-series attribute curves from each patient, so
that they can be easily compared and aggregated together.
Returns:
Dataframe with the average curve of an image attribute by patient group, in long format.
Dataframe with the average curve of an time-series attribute by patient group, in long format.
"""
resampling_fn = Interp1d(resampling_rate)

Expand Down
Loading

0 comments on commit 5a08b22

Please sign in to comment.