bhklab / med-imagetools

Transparent and reproducible medical image processing pipelines in Python.
MIT License
36 stars 9 forks source link

variable substitution #125

Closed jjjermiah closed 4 weeks ago

jjjermiah commented 1 month ago

https://github.com/bhklab/med-imagetools/blob/5546cec94f1cfe1e3fb4a2dff28a4c1e5275216e/src/imgtools/ops/ops.py#L366-L410

lines 391-397 does {subject_id} get manipulated later?

Traceback (most recent call last):
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/bin/autopipeline", line 8, in <module>
    sys.exit(main())
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/autopipeline.py", line 726, in main
    pipeline = AutoPipeline(**args_dict)
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/autopipeline.py", line 324, in __init__
    self.output = ImageAutoOutput(self.output_directory, self.output_streams, self.nnunet_info, self.is_nnunet_inference)
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/ops/ops.py", line 391, in __init__
    self.output[colname_process] = ImageSubjectFileOutput(pathlib.Path(root_directory,"{subject_id}",colname_process.split(".")[0]).as_posix(),
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/ops/ops.py", line 358, in __init__
    writer = BaseSubjectWriter(self.root_directory,
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/io/writers.py", line 50, in __init__
    super().__init__(root_directory, filename_format, create_dirs)
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/site-packages/imgtools/io/writers.py", line 25, in __init__
    os.makedirs(self.root_directory)
  File "/home/bioinf/bhklab/radiomics/radiomics_orcestra/.snakemake/conda/bfb1f0f9383ec78eae7304db3f981457_/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/{subject_id}/CT'
skim2257 commented 1 month ago

Yes, the path is subsequently modified with .format(subject_id) during the output process

jjjermiah commented 1 month ago

ah makes sense, will look into how its failing