Closed LennartPhil closed 4 months ago
Thanks for your interest in our preprocessing pipeline. Could you specify a bit where exactly the tutorial crashes? Which registration backend do you use?
Do you have an Intel or ARM based Mac?
@MarcelRosier could you please have a look? Might be related to: https://github.com/BrainLesion/HD-BET/issues/1
I'm trying to run the code on a Apple M3 Pro chip. What exactly do you mean by registration backend?
Ah this is probably the issue:
preprocessor = Preprocessor(
center_modality=center,
moving_modalities=moving_modalities,
registrator=NiftyRegRegistrator(),
brain_extractor=HDBetExtractor(),
# optional: we provide a temporary directory as a sandbox for the preprocessin
temp_folder="temporary_directory",
limit_cuda_visible_devices="0",
)
Here, you can specify the registration backend:
registrator=NiftyRegRegistrator(),
Niftyreg does not have Mac support. You could try ANTs or eReg(experimental).
So instead, supply another registrator:
from brainles_preprocessing.registration import (
ANTsRegistrator,
NiftyRegRegistrator,
eRegRegistrator,
)
...
# choose the registration backend you want to use
# registrator=NiftyRegRegistrator(),
registrator=ANTsRegistrator(),
# registrator=eRegRegistrator(),
@evamariie could you please update the tutorial to tell users about the different registration backends?
Arguably, ANTs should be the default for the moment as it does not only support Linux like Niftyreg. And eReg is not fully tested yet.
@evamariie Also, the readme needs to be updated, please prepare a PR :) https://github.com/BrainLesion/preprocessing?tab=readme-ov-file#registration
Thank you for your help, changing the registrator to ANTs worked wonderfully. It might also be worth noting that when using HDBetExtractor on a arm processor, one must set the device to "cpu"
Thank you for your help, changing the registrator to ANTs worked wonderfully. It might also be worth noting that when using HDBetExtractor on a arm processor, one must set the device to "cpu"
Sweet, thanks for reporting back. Did you try with the most recent version of our package? Above you are indicating an older version.
@MarcelRosier recently implemented a fix, which should fix the CPU issue: https://github.com/BrainLesion/HD-BET/pull/2
My bad, using the newest version resolved the cpu workaround as well
Sweet, thanks for reporting back, and I'm glad everything could be resolved. We highly appreciate feedback as we are still in an earlier stage of development :)
Describe the bug When trying to run the preprocessing_tutorial.ipynb I get a
FileNotFoundError
, which reads[Errno 2] No such file or directory: Path('/Users/XXXXXXXXX/Desktop/Uni/Prowiss/Code/preprocessing/temporary_directory/atlas-space/atlas__t1c.nii.gz')
Expected behavior As I used the exact same files from the tutorial, I expected the test files to get preprocessed as described in there.
Environment
operating system and version?
mac OS Sonoma 14.3.1
NVIDIA drivers and GPUs
no NVIDIA drivers installed
Python environment and version?
running a virtual environment with python 3.11 installed
version of brainles_preprocessing ?
0.1.1
Additional context I think I have roughly located the location of the error within the
preprocessor.py
file, asself.center_modality.current
can't be found after the following linesOutput: Check 03 Checking existence of directory: /Users/XXXXXXXXX/Desktop/Uni/Prowiss/Code/preprocessing/sample_data/TCGA-DU-7294/AX_T1_POST_GD_FLAIR_TCGA-DU-7294_TCGA-DU-7294_GE_TCGA-DU-7294_AX_T1_POST_GD_FLAIR_RM_13_t1c.nii.gz Directory exists: True Check 04 Checking existence of directory: /Users/XXXXXXXXX/Desktop/Uni/Prowiss/Code/preprocessing/temporary_directory/atlas-space/atlas__t1c.nii.gz Directory exists: False