mesoSPIM / mesoSPIM-control

Image acquisition software for mesoSPIM light-sheet microscopes.
http://www.mesospim.org
GNU General Public License v3.0
35 stars 11 forks source link

Automatically save reslices and max-projections #2

Open ffvoigt opened 5 years ago

ffvoigt commented 5 years ago

This is intended both to streamline quality control checks and to debug acquisitions.

Users should be able to select one of the following options for each row in the Acquisition Manager:

This way, for a single stack, multiple datasets can be created on the fly:

resclice-inverted

This will require touching the following parts of the code:

Here is some code from my experiments with this in the camera thread:

In prepare_stack():

self.xz_stack = np.memmap(self.path[:-4]+'xz.raw', mode = "write", dtype = np.uint16, shape = 2048 * self.max_frame * 2048)
self.yz_stack = np.memmap(self.path[:-4]+'yz.raw', mode = "write", dtype = np.uint16, shape = 2048 * self.max_frame * 2048)

In add_images_to_stack():

''' Write YZ (coronal) image '''
for j in range(2048):
    line =  data[j*2048:(j+1)*2048]
     self.yz_stack[2048*j*self.max_frame+2048*self.cur_frame:2048*j*self.max_frame+2048*self.cur_frame+2048] = line

In end_stack(), one should make sure to delete the self.yz_stack object as it might need a lot of memory.

alecrimi commented 5 years ago

using the code as describer in "add_images_to_series()" the resliced volume seems to have the lines ordered sequencially rather than rotated. See picture below with original slice (left) and resliced (right) reslice

ffvoigt commented 5 years ago

I think you have to open the stack differently in Fiji: Import as raw, then set the X & Y according to the stack parameters (e.g. 2048 pixel width for X times number of z-steps for Y). Number of images should be 2048. For a YZ reslice, you have to change the import values accordingly.

alecrimi commented 5 years ago

I have now linked the reslicing and maxproj to delegates of the AcquisitionManagerWindows. By default all values are "no", namely unless the user changes the this from the gui no max projection or reslicing is computed. The are some IFs statement in mesoSPIM_camera.py that check whether the value is "no" or "yes" and in case compute and save the reslicing or the max projection. The Wizard still needs to be implemented

ffvoigt commented 5 years ago

Can you put this in a branch somewhere where I can see it?