Skip to content

Automatically save reslices and max-projections #2

Description

@ffvoigt

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:

  • save xy max projection of the stack (most important)
  • save full xz / yz reslices of the stack (xz has priority)
  • save maximum projections of full and partial reslices (e.g. select to split the resliced volume in 1 to 10 subvolumes and do a partial reslice there)

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:

  • in the camera thread (mesoSPIM_Camera.py), the computations should be executed
  • add a corresponding row to acquisitions.py (e.g. a dictionary that allows specifying which online-processing steps should be taken and with which parameters)
  • add a delegate in delegates.py to have a button that opens a GUI (e.g. a wizard) to specify which processing steps should be executed

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions