Hi Osman,
thank you for your advanced questions! I don't have simple answers but can only suggest two hacks.
1. True, there is only one type of NeighborhoodReporter with one chosen distance. But you can set this neighborhood distance to the maximum that your model needs (e.g. 10 in your example) and use the following hack. Mind to correctly choose 'distance' or 'order'. Then one of your NeighborhoodReporters works out of the box. For the narrower neighborhood, you then have to insert a condition into the Input of that NeighborhoodReporter and thereby reset the unwanted inputs from larger distance to a trivial value (e.g. zero in a sum or maximum stats). To measure the distance between the two centers of mass of a pair of neighboring cells (and use that in the filter condition), you have to use the scope-prefix 'local.' as the NeighborhoodReporter normally evaluates all symbols in the scope of a neighboring cell. Hence your Input would look like this (on a 2D square or hex lattice):
(sqrt((cell.center.x-local.cell.center.x)^2+(cell.center.y-local.cell.center.y)^2) <= short_distance) * (cell.type ==
celltype.second.id)
Note, that the <= will evaluate the second condition for all cells at distance==short_distance AND CLOSER, else replace the <= by == to get the fewer cells at exactly that distance (but check if you need some tolerance due to the numerics here).
This hack has been used before in a model of viral infection of a tissue where cells were single nodes on a hex lattice and there was no cell movement or CPM mechanics, please see and run:
https://identifiers.org/morpheus/M7677There are also limits to this hack since the neighborhood kernels are so far implemented for 'reasonable' distances and orders. But it should be relatively easy to fork the source code and duplicate the three NeighborhoodReporter files and modify the copy towards MyNeighborhoodReporter and build MyMorpheus.
For details on the kernels (for each lattice type) and on the 'local.' scope, please also see the in-app docu.
2. There is no public DistanceTransform plugin in Morpheus yet. But under GUI/Analysis, you may check the various Tracker Plugins (e.g. ClusteringTracker) if they are useful for you. Else you can use the 'External' Plugin and let that periodically start an external script to calculate and plot distances from saved data in files.
This has been used in
https://identifiers.org/morpheus/M0007 to calculate the radial density statistics on the fly.
However, results from those external calculation cannot feed back into the running model. If you need the latter, then you could work with the Morpheus-Python interface that is provided as a Docker container with a matching Python from
https://morpheus.gitlab.io/model/m0006/#installation-instructionsThat Morpheus-Python interface has been applied in
https://identifiers.org/morpheus/M0006 and more advanced in
https://identifiers.org/morpheus/M0008Please let us know here if any of the above is useful or otherwise open a feature request here:
https://gitlab.com/morpheus.lab/morpheus/-/issues (which may queue for a while).
Best,
Lutz for Morpheus.lab