Avoiding large memory load and processing time when running apply_shifts_movie on 3d datasets? #1472
Replies: 2 comments 3 replies
-
Just did a test where I tried processing movies of increasing size and I think the issue is definitely a memory one. You can see motion correction runtime is pretty linear, and applying shifts has a huge jump which corresponds to when I see that I am running out of RAM and I suppose I start swapping which of course slows down the performance greatly and imposes an upper limit on the size of movie I can process. Is there a workaround for this? Can you point me to how I might modify the apply_shifts_movie function to be as memory-efficient as motion_correct ? |
Beta Was this translation helpful? Give feedback.
-
I'm confused about exactly what you're doing. What do you mean by smoothing? Are you applying a Gaussian filter across space? Are you doing a rolling average over time? Gaussian temporal filter? Can you provide code to reproduce this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm working with fairly noisy volumetric 2p imaging data and it is neccessary for me to perform some smoothing (across space and time) for motion correction to work properly. I therefore have to compute the shifts on smoothed data and then apply them to the raw data.
I've found that MotionCorrect.apply_shifts_movie works very quickly for small example datasets (like the generated data in demo_caimaon_cnmf_3D.ipynb. However, for more realistic datasets (for example: 5k frames, 128 x 256 resolution, 10 planes) I find that running this function results in a large memory load (>40GB sometimes for a movie that is ~5GB) and very slow runtime (several times slower than the original motion correction). This is even the case when working with mem mapped files as the input. I am a bit confused because the runtime and memory load are way higher than when I run the motion correction itself (which takes about a minute on my machine).
Am I missing someting about how to apply shifts? I have no issue running the motion correction itself. I've tried adjusting n_processes down to 1 or 2 and I still have the same issue.
Thanks in advance for any advice!
Beta Was this translation helpful? Give feedback.
All reactions