diff --git a/clinicadl/utils/iotools/clinica_utils.py b/clinicadl/utils/iotools/clinica_utils.py index 68426fa8e..ef6fb4a00 100644 --- a/clinicadl/utils/iotools/clinica_utils.py +++ b/clinicadl/utils/iotools/clinica_utils.py @@ -35,13 +35,14 @@ class FileType(BaseModel): needed_pipeline: Optional[str] = None @field_validator("pattern", mode="before") - def check_pattern(self, v): + def check_pattern(cls, v): if v[0] == "/": raise ValueError( "pattern argument cannot start with char: / (does not work in os.path.join function). " "If you want to indicate the exact name of the file, use the format " "directory_name/filename.extension or filename.extension in the pattern argument." ) + return v class FileReader(BaseModel):