Skip to content

Commit

Permalink
default preprocessing in capsdataset
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultdvx committed Dec 19, 2024
1 parent 3a3e0dd commit f18f5fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clinicadl/data/datasets/caps_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pydantic import NonNegativeInt
from torch.utils.data import Dataset

from clinicadl.data.preprocessing import Preprocessing
from clinicadl.data.preprocessing import Preprocessing, PreprocessingT1
from clinicadl.data.readers.caps_reader import CapsReader
from clinicadl.data.utils import (
check_df,
Expand Down Expand Up @@ -69,7 +69,7 @@ class CapsDataset(Dataset):
def __init__(
self,
caps_directory: Union[str, Path],
preprocessing: Preprocessing,
preprocessing: Preprocessing = PreprocessingT1(),
transforms: Transforms = Transforms(),
data: Optional[Union[pd.DataFrame, str, Path]] = None,
label: Optional[str] = None,
Expand Down Expand Up @@ -208,7 +208,7 @@ def describe(self):
}

def _get_df_from_input(
self, data: Optional[Union[pd.DataFrame, Path]]
self, data: Optional[Union[pd.DataFrame, Path, str]]
) -> pd.DataFrame:
"""
Generates or validates the DataFrame from the input data.
Expand Down Expand Up @@ -248,7 +248,7 @@ def _get_df_from_input(

return df

def _check_data_instance(self, data: Optional[Union[pd.DataFrame, Path]] = None):
def _check_data_instance(self, data: Optional[Union[pd.DataFrame, Path, str]]):
if isinstance(data, str):
data = Path(data)

Expand Down

0 comments on commit f18f5fe

Please sign in to comment.