forked from Remi-Gau/bidsNighres
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
New feature
With upsampled data, the layering of one subject is "killed" after cruise step of first hemisphere due to memory (RAM) issue. Working with a computer with 64GB of RAM.
Not sure but I suspect that the problem is that the code keeps the output of the below functions dave in the output variable hogging the memory.
cortex = nighres.brain.extract_brain_region(
segmentation=segmentation_img[0],
levelset_boundary=levelset_boundary_img[0],
maximum_membership=max_membership_img[0],
maximum_label=max_label_img[0],
extracted_region=roi,
save_data=True,
file_name=f"{output_filename}_hemi-{label}",
output_dir=output_dir,
)
cruise = nighres.cortex.cruise_cortex_extraction(
init_image=cortex["inside_mask"],
wm_image=cortex["inside_proba"],
gm_image=cortex["region_proba"],
csf_image=cortex["background_proba"],
normalize_probabilities=True,
save_data=True,
file_name=f"{output_filename}_hemi-{label}",
output_dir=output_dir,
)
My possible solution, if this is the problem, would be to refactor the code and after eg the first step `cortex = nighres.brain.extract_brain_region` clear `cortex` and make `cruise = nighres.cortex.cruise_cortex_extraction` load the nii saved output of the previous step.
Though, the saved files from these two steps do not wait more than ~4GBUnclear documentation
No response
Metadata
Metadata
Assignees
Labels
No labels