Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Redeploy PET support with --skim option #122

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion handler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt update && \
RUN apt install -y parallel python3 python3-pip tree curl unzip git jq python libgl-dev python-numpy

RUN pip3 install numpy==1.23.0 nibabel==4.0.0 pandas==1.0.1 matplotlib pyyaml==5.4.1 pydicom==2.3.1 natsort pydeface && \
pip3 install quickshear pypet2bids==1.3.5 mne mne-bids
pip3 install quickshear pypet2bids==1.3.9 mne mne-bids

RUN apt-get install -y build-essential pkg-config cmake git pigz rename zstd libopenjp2-7 libgdcm-tools wget libopenblas-dev && \
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
Expand Down
41 changes: 20 additions & 21 deletions handler/find_img_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,26 @@ def find_img_data(dir):

find_img_data('.')

# # PET
# # TODO - Line below line take several seconds to complete, maybe can be sped up?
# pet_folders = [str(folder) for folder in is_pet.pet_folder(Path(root).resolve())]
# pet_folders = [os.path.relpath(x, root) for x in pet_folders if x != '']
# pet_folders = [os.path.join('.', x) for x in pet_folders]

# if pet_folders:
# for pet in pet_folders:
# # See if we're dealing ECAT-formatted file(s)
# ecats = [x for x in os.listdir(pet) if x.endswith(tuple(['.v', '.v.gz']))]
# if len(ecats):
# for ecat in ecats:
# if ecat not in pet_ecat_files_list:
# pet_ecat_files_list.append(f'{pet}/{ecat}')
# # See if we're dealing with DICOM files
# dcms = [
# x for x in os.listdir(pet)
# if not x.endswith(tuple(['.nii', '.nii.gz', '.v', '.v.gz', '.json', '.tsv']))
# ]
# if len(dcms) and pet not in pet_dcm_dirs_list:
# pet_dcm_dirs_list.append(pet)
# PET
pet_folders = [str(folder) for folder in is_pet.pet_folder(Path(root).resolve(), skim=True, njobs=4)]
pet_folders = [os.path.relpath(x, root) for x in pet_folders if x != '']
pet_folders = [os.path.join('.', x) for x in pet_folders]

if pet_folders:
for pet in pet_folders:
# See if we're dealing ECAT-formatted file(s)
ecats = [x for x in os.listdir(pet) if x.endswith(tuple(['.v', '.v.gz']))]
if len(ecats):
for ecat in ecats:
if ecat not in pet_ecat_files_list:
pet_ecat_files_list.append(f'{pet}/{ecat}')
# See if we're dealing with DICOM files
dcms = [
x for x in os.listdir(pet)
if not x.endswith(tuple(['.nii', '.nii.gz', '.v', '.v.gz', '.json', '.tsv']))
]
if len(dcms) and pet not in pet_dcm_dirs_list:
pet_dcm_dirs_list.append(pet)

# MEG
MEG_extensions = ['*.ds', '*.fif', '*.sqd', '*.con', '*.raw', '*.ave', '*.mrk', '*.kdf', '*.mhd', '*.trg', '*.chn', '*.dat']
Expand Down
Loading