Skip to content

Commit

Permalink
solve mask_path pb
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed Jun 6, 2024
1 parent e011574 commit 4819d0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions clinicadl/caps_dataset/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ def __init__(
self.roi_list = preprocessing_dict["roi_list"]
self.uncropped_roi = preprocessing_dict["uncropped_roi"]
self.prepare_dl = preprocessing_dict["prepare_dl"]

self.mask_paths, self.mask_arrays = self._get_mask_paths_and_tensors(
caps_directory, multi_cohort, preprocessing_dict
)
super().__init__(
caps_directory,
data_file,
Expand All @@ -531,15 +533,12 @@ def __init__(

self.config.preprocessing.roi_list = preprocessing_dict["roi_list"]
self.config.preprocessing.uncropped_roi = preprocessing_dict["uncropped_roi"]
(
self.config.preprocessing.mask_paths,
self.config.preprocessing.mask_arrays,
) = self._get_mask_paths_and_tensors(
caps_directory, multi_cohort, preprocessing_dict
)
self.mask_paths, self.mask_arrays = self._get_mask_paths_and_tensors(
self.config.data.caps_dict, multi_cohort, preprocessing_dict
)
# (
# self.config.data.mask_path,
# self.config.preprocessing.mask_arrays,
# ) = self._get_mask_paths_and_tensors(
# caps_directory, multi_cohort, preprocessing_dict
# )

@property
def elem_index(self):
Expand Down
4 changes: 2 additions & 2 deletions clinicadl/preprocessing/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Annotated, Any, Dict, Optional, Union

from pydantic import BaseModel, ConfigDict, field_validator
from pydantic.types import PositiveInt
from pydantic.types import NonNegativeInt

from clinicadl.utils.enum import (
ExtractionMethod,
Expand Down Expand Up @@ -56,7 +56,7 @@ class PreprocessingSliceConfig(PreprocessingConfig):
extract_method: ExtractionMethod = ExtractionMethod.SLICE
slice_direction: SliceDirection = SliceDirection.SAGITTAL
slice_mode: SliceMode = SliceMode.RGB
discarded_slices: Annotated[list[PositiveInt], 2] = [0, 0]
discarded_slices: Annotated[list[NonNegativeInt], 2] = [0, 0]


class PreprocessingROIConfig(PreprocessingConfig):
Expand Down

0 comments on commit 4819d0e

Please sign in to comment.