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

Volume discrepancy between scilpy and tractometry_flow scripts #793

Open
cbedetti opened this issue Oct 24, 2023 · 1 comment
Open

Volume discrepancy between scilpy and tractometry_flow scripts #793

cbedetti opened this issue Oct 24, 2023 · 1 comment

Comments

@cbedetti
Copy link

Hi,

I'm running scil_evaluate_bundles_individual_measures.py, scil_compute_bundle_volume.py and the last version of tractometry_flow (a42d1d7) inside a scilpy 1.6.0 container.

I tested it with the AF_R bundle from HCP 100206.

  • scil_evaluate_bundles_individual_measures.py
"volume": [
    70150.390625
  ],
  • scil_compute_bundle_volume.py
{
  "100206__AF_R": {
    "volume": 70150.390625
  }
}
  • tractometry_flow
"100206": {
    "AF_R": {
      "volume": 69072.265625
    }
  }

Is there a reason for this difference?

@frheault
Copy link
Member

Hi,

Yes, it is normal. To increase consistency, code in the script scripts/scil_compute_bundle_voxel_label_map.py ensures that a bundle is contiguous (no isolated voxels in the binary mask). Due to edge cases in the computation (in low-density areas, close to endpoints in fanning regions), some voxels are considered isolated (not touching the main bundle).

This result is mostly explainable because the function ndi.label uses a flood fill based using a cross structure (6 neighbors) rather than a ball structure (26 neighbors). @arnaudbore what do you think?

    bundle_disjoint, _ = ndi.label(binary_bundle)
    unique, count = np.unique(bundle_disjoint, return_counts=True)
    val = unique[np.argmax(count[1:])+1]
    binary_bundle[bundle_disjoint != val] = 0

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

No branches or pull requests

2 participants