Alignment for bigger SBF-SEM datasets

Hello Ilya,

first of all thank you for providing this very useful and free tool for image segmentation. We are currently trying to establish possible workflows for our SBF-SEM and thus stumbled upon your program.

However we were facing some problems when it comes to handling data of bigger size. Mainly there are problems with Image Alignment. When doing the drift correction algorithm, after alculating the drifts an error message appears:

Error using zeros
Requested 4391x205780x1x329 (276.9GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.

Error in mibCrossShiftStack (line 64)

Error in mibAlignmentController/continueBtn_Callback (line 998)

Error in mibAlignmentGUI>continueBtn_Callback (line 342)

Error in gui_mainfcn (line 95)

Error in mibAlignmentGUI (line 52)

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)mibAlignmentGUI(‘continueBtn_Callback’,hObject,eventdata,guidata(hObject))

Error using pause (line 20)
Error while evaluating UIControl Callback.

Is there a way to increase the performance of MIB, like setting the memory usage cap higher or make him use multiple threads? I noticed that MIB did not make use of all available RAM. We are currently using a special workstation with 128 GB RAM and Intel Core i9-7960x CPU 2.8 GHz.

We are using the standalone version of MIB and are working with a dataset of around 4 GB in size with an image size of 4000x4000 pixels (pixel size x/y = 0.00303124 µm , pixel size z = 0.03 µm). I don’t understand why the array size becomes as big as the error message states.

Maybe you have an idea and thank you in advance,

Leo

Hi Leo,
welcome to the forum!
So far, there is no way to go beyond available memory during alignment. I have plans to make those, since I bumped into that couple of times, but it is not yet done.
Considering you case - you should have sufficient amount of memory to proceed, but from the error message I can see that the alignment procedure expects significant shifts between the sections (especially in the width dimension): Requested 4391x205780x1x329, which makes me think that it has failed to register the images.
Are you using the full image or selected areas for the detection of drifts?
In some cases, especially when the size (width/height) of the imaged area is different between sections the full image alignment won’t work and it is better to find displacements using predefined areas, as demonstrated here:

I hope this helps
Ilya

`

Hey Ilya,

thank you for your quick reply. The alignment worked after I took a closer look on the individual slices and found one black sheep that was too much out of focus for the automatic registration.

Though, I stumbled upon another problem - apparently related to memory space/data handling: when trying to open a larger .rec file (about 4 GB) the log says once again “out of memory”. Smaller files in this format can be opened without problems. The data set is a TEM-tomography, segmented/aligned using IMOD. As far as I know the rec-data is part of the .mrc, IMOD is using.

Stay healthy :wink: ,

Leo

Hi Leo,

thank you for your quick reply. The alignment worked after I took a closer look on the individual slices and found one black sheep that was too much out of focus for the automatic registration.

good to hear!

when trying to open a larger .rec file (about 4 GB) the log says once again “out of memory”.

this is harder to address. We also read mrc-files, but in our case they are rather small, i.e. <1Gb. To read them I am using an external package and perhaps something is not optimized there. As we discussed, 4 Gb should not be a problem. But the only way to address that is have a similar sized file for tests. If you can share the file or make a dummy file with similar dimensions/size I can take a look.
Also, can you open that file normally with IMOD?

Ilya

Hi Ilya,

you can download the file (3.4 GB) from our cloud here: https://myshare.uni-osnabrueck.de/f/59cb7212f56a407c985b/?dl=1

Thank you for looking into that, take your time :slight_smile: The fellow colleague who did the tomogram told me to warn you about the beginning and end being out of focus - apparently a matter of microscope calibration. The file however can be opened with IMOD without any issues.

Cheers,

Leo

Hi Leo,
thank you for the dataset, indeed it also gives an error in my case.
As a meanwhile solution, you can use bio-formats reader to open this format. To do so, you need to register “rec” as an extension by right mouse click over the Filter dropdown and select Register extension:
image

Add rec and rec to both normal and virtual mode readers of MIB and press OK
image

After that you will be able to load the dataset (make sure that the Bio checkbox is checked).

Best regards,
Ilya

1 Like