Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 403d8766 authored by CERUTTI Guillaume's avatar CERUTTI Guillaume
Browse files

add optional mesh input to cell curvature plugin

parent 2f5d0746
No related branches found
No related tags found
1 merge request!5mesh input for quantification plugins
......@@ -7,7 +7,7 @@ import pandas as pd
from dtkcore import d_real, d_inliststring
from gnomon.utils import algorithmPlugin
from gnomon.utils.decorators import cellImageInput, cellImageOutput, dataFrameOutput
from gnomon.utils.decorators import cellImageInput, meshInput, cellImageOutput, dataFrameOutput
from gnomon.core import gnomonAbstractCellImageQuantification
from timagetk import TissueImage3D
......@@ -18,6 +18,7 @@ from timagetk_geometry.features.tissue_mesh import compute_cell_curvature_featur
@algorithmPlugin(version="0.3.0", coreversion="0.81.0", name="Surface Mesh Curvature")
@meshInput('surface_topomesh', data_plugin="gnomonMeshDataPropertyTopomesh")
@cellImageInput("tissue", data_plugin="gnomonCellImageDataTissueImage")
@cellImageOutput("out_tissue", data_plugin="gnomonCellImageDataTissueImage")
@dataFrameOutput('df', data_plugin="gnomonDataFrameDataPandas")
......@@ -34,6 +35,7 @@ class surfaceMeshCellCurvature(gnomonAbstractCellImageQuantification):
super().__init__()
self.tissue = {}
self.surface_topomesh = {}
self.out_tissue = {}
self.df = {}
......@@ -65,13 +67,16 @@ class surfaceMeshCellCurvature(gnomonAbstractCellImageQuantification):
out_tissue.cells = deepcopy(tissue.cells)
out_tissue.cells.image = out_tissue
surface_topomesh = tissue_image_surface_topomesh(
out_tissue,
resampling_voxelsize=self['resampling_voxelsize'],
surface_matching='cell',
orientation=(1 if self['orientation'] == "up" else -1),
down_facing_threshold=self['down_facing_threshold']
)
if time in self.surface_topomesh:
surface_topomesh = self.surface_topomesh[time]
else:
surface_topomesh = tissue_image_surface_topomesh(
out_tissue,
resampling_voxelsize=self['resampling_voxelsize'],
surface_matching='cell',
orientation=(1 if self['orientation'] == "up" else -1),
down_facing_threshold=self['down_facing_threshold']
)
compute_cell_curvature_features(out_tissue, surface_topomesh=surface_topomesh)
self.out_tissue[time] = out_tissue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment