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

count_ratio on different partitions #885

Open
drodarie opened this issue Sep 20, 2024 · 0 comments · May be fixed by #886
Open

count_ratio on different partitions #885

drodarie opened this issue Sep 20, 2024 · 0 comments · May be fixed by #886
Assignees
Labels
bug Something isn't working

Comments

@drodarie
Copy link
Contributor

{
    "name": "Test",
    "storage": {
        "engine": "hdf5",
        "root": "test.hdf5"
    },
    "network": {
        "chunk_size": [
            100,
            100,
            100
        ],
        "x": 100,
        "y": 100,
        "z": 300
    },
    "regions": {
        "cerebellar_cortex": {
            "type": "stack",
            "children": [
                "granular_layer",
                "molecular_layer"
            ]
        }
    },
    "partitions": {
        "granular_layer": {
            "thickness": 200
        },
        "molecular_layer": {
            "thickness": 100
        }
    },
    "cell_types": {
        "glomerulus": {
            "spatial": {
                "count": 10,
                "radius": 1.5
            }
        },
        "mossy_fibers": {
            "spatial": {
                "count_ratio": 0.5,
                "radius": 1.5,
                "relative_to": "glomerulus"
            }
        }
    },
    "placement": {
        "granular_layer_innervation": {
            "strategy": "bsb.placement.RandomPlacement",
            "partitions": [
                "granular_layer"
            ],
            "cell_types": [
                "mossy_fibers"
            ]
        },
        "granular_layer_placement": {
            "strategy": "bsb.placement.RandomPlacement",
            "partitions": [
                "molecular_layer"
            ],
            "cell_types": [
                "glomerulus"
            ]
        }
    },
    "connectivity": {}
}

The following configuration will place 10 glomerulus and 0 mossy_fibers because the cells are not in the same partition.

I believe the bug happens because of the function PlacementIndicator.guess on the relative cell. This function returns the number of glomerulus that have been placed in the chunk, based on the function Rhomboid.volume; in this case 0 because the partitions don't overlap. Here is the partial stack:

volume, partition.py:183
<genexpr>, indicator.py:190
_estim_for_chunk, indicator.py:190
guess, indicator.py:91
<genexpr>, indicator.py:102
guess, indicator.py:101
<listcomp>, random.py:27
_fill_system, random.py:20
place, random.py:59
[...]

The ratio of volume measurement should happen during the guess of mossy_fibers and not glomerulus here.

@drodarie drodarie added the bug Something isn't working label Sep 20, 2024
@drodarie drodarie self-assigned this Sep 20, 2024
@drodarie drodarie linked a pull request Sep 21, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant