Crazy RAM Usage of mmr-graphical when using bigger files
I am currently trying to align some bigger files using spam-mmr-graphical.
Unfortunately however, the RAM usage prevents me from running the script at bin 1. Aligning two 2.4 GB scans (2048x2048x622) uses >210GB of RAM. I don't know the exact number because the process got killed at that point.
One time it actually passed an error message but it only prints
killed most of the time:
Memory Error: Unable to allocate 18.9 GiB for an array with shape (2541907728,) and data type int64
Is there any way to reduce the required RAM besides running at lower binning or splitting the images to smaller pieces? Spam-mmr requires less RAM but is not useful in the current form in my case because I need to select phases manually / combine certain neighboring peaks in the joint histogram.
Also, spam-mmr misses maxima in the joint histogram on the edge due to the exclude_border tag not being included for skimage.
skimage.feature.peak_local_max(self.hist, min_distance=minDistance, num_peaks=self.nbMaxPeakSlider.value(), exclude_border=excludeBorder) of spam-mmr-graphical
maxima = skimage.feature.peak_local_max(p, min_distance=int(distanceMaxima)) of spam-mmr