Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dealing with moving ROIs/cells or ROIs from tracking #48

Open
pr4deepr opened this issue Sep 12, 2023 · 1 comment
Open

dealing with moving ROIs/cells or ROIs from tracking #48

pr4deepr opened this issue Sep 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@pr4deepr
Copy link
Collaborator

Currently, napari-lattice works only with a single ROI and it assumes that the cell doesn't move much.
If cell wobbles a bit, we just draw a bigger ROI.
This is all done using the MIP image after image acquisition for Zeiss lattice.

We need to define how this is going to look like, i..e., scheme of the pydantic model if using this approach and best way to integrate it.

@pr4deepr pr4deepr added the enhancement New feature or request label Sep 12, 2023
@multimeric
Copy link
Collaborator

Currently in my branch I define the ROIs as a list of shapes, each of which is defined as an array:

roi_layer_list: ShapesData

To handle a movable ROI, we would need to define a new ROI type as a Pydantic model, which would at least contain the region as an array, and the timepoint it corresponds to:

class Roi(BaseModel):
    region: ShapesData
    time_point: int

Then the ROI list becomes a list of these new models:

class CropParams(BaseModel, arbitrary_types_allowed=True):
    roi_layer_list: List[Roi]

Finally, the logic to create CropParams, and to also to perform the cropping would have to change to accomodate this new structure and logic:

yield ProcessedVolume(
data = crop_volume_deskew(
original_volume=data,
deconvolution=self.deconv_enabled,
get_deskew_and_decon=False,
debug=False,
roi_shape=roi,
linear_interpolation=True,
voxel_size_x=self.dx,
voxel_size_y=self.dy,
voxel_size_z=self.dy,
angle_in_degrees=self.angle,
deskewed_volume=self.deskewed_volume,
z_start=self.crop.z_start,
z_end=self.crop.z_end,
**deconv_args
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants