From b60c2f04ba107f998d68640dcb8c7ed3c7927bf8 Mon Sep 17 00:00:00 2001 From: Blaise deB Frederick Date: Sun, 3 Nov 2024 13:26:37 -0500 Subject: [PATCH] Deleted coherence outputs a bit too early --- rapidtide/workflows/rapidtide.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rapidtide/workflows/rapidtide.py b/rapidtide/workflows/rapidtide.py index 4978a00e..824db40d 100755 --- a/rapidtide/workflows/rapidtide.py +++ b/rapidtide/workflows/rapidtide.py @@ -3070,13 +3070,6 @@ def rapidtide_main(argparsingfunc): rt_floattype=rt_floattype, cifti_hdr=cifti_hdr, ) - del coherencefunc - del coherencepeakval - del coherencepeakfreq - if optiondict["sharedmem"]: - tide_util.cleanup_shm(coherencefunc_shm) - tide_util.cleanup_shm(coherencepeakval_shm) - tide_util.cleanup_shm(coherencepeakfreq_shm) TimingLGR.info( "Coherence calculation end", @@ -3521,6 +3514,14 @@ def rapidtide_main(argparsingfunc): dictvarname="MTThist", thedict=optiondict, ) + if optiondict["calccoherence"]: + del coherencefunc + del coherencepeakval + del coherencepeakfreq + if optiondict["sharedmem"]: + tide_util.cleanup_shm(coherencefunc_shm) + tide_util.cleanup_shm(coherencepeakval_shm) + tide_util.cleanup_shm(coherencepeakfreq_shm) # write the optional 3D maps that need to be remapped if optiondict["doglmfilt"] or optiondict["docvrmap"]: