Skip to content

Commit

Permalink
ready for review
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed Jun 10, 2024
1 parent 72130d1 commit 15be72f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion clinicadl/quality_check/t1_linear/quality_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from torch.cuda.amp import autocast
from torch.utils.data import DataLoader

from clinicadl.caps_dataset.data import CapsDataset
from clinicadl.caps_dataset.caps_dataset_config import CapsDatasetConfig
from clinicadl.generate.generate_utils import load_and_check_tsv
from clinicadl.utils.clinica_utils import RemoteFileStructure, fetch_file
from clinicadl.utils.enum import ExtractionMethod, Preprocessing
Expand Down Expand Up @@ -68,6 +68,7 @@ def quality_check(
logger = getLogger("clinicadl.quality_check")
config = CapsDatasetConfig.from_preprocessing_and_extraction_method(
caps_directory=caps_dir,
extraction=ExtractionMethod.IMAGE,
preprocessing_type=Preprocessing.T1_LINEAR,
preprocessing=Preprocessing.T1_LINEAR,
use_uncropped_image=use_uncropped_image,
Expand Down
8 changes: 2 additions & 6 deletions clinicadl/quality_check/t1_linear/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from clinicadl.caps_dataset.caps_dataset_utils import compute_folder_and_file_type
from clinicadl.utils.clinica_utils import clinicadl_file_reader, linear_nii
from clinicadl.utils.enum import LinearModality, Preprocessing
from clinicadl.utils.exceptions import ClinicaDLException


class QCDataset(Dataset):
Expand Down Expand Up @@ -39,7 +40,7 @@ def __init__(
if ("session_id" not in list(self.df.columns.values)) or (
"participant_id" not in list(self.df.columns.values)
):
raise Exception(
raise ClinicaDLException(
"The data file is not in the correct format."
"Columns should include ['participant_id', 'session_id']"
)
Expand All @@ -53,11 +54,6 @@ def __init__(
"file_type": linear_nii(LinearModality.T1W, self.use_uncropped_image),
"use_tensor": self.use_extracted_tensors,
}
self.config = PrepareDataImageConfig(
caps_directory=Path(""),
preprocessing_cls=Preprocessing.T1_LINEAR,
use_uncropped_image=use_uncropped_image,
)

def __len__(self):
return len(self.df)
Expand Down

0 comments on commit 15be72f

Please sign in to comment.