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

Add 1st order neighbour finder program LN2_NEIGHBORS #66

Closed
ofgulban opened this issue Feb 3, 2023 · 2 comments
Closed

Add 1st order neighbour finder program LN2_NEIGHBORS #66

ofgulban opened this issue Feb 3, 2023 · 2 comments
Labels
done Resolved issues that can be mentioned in the release notes. new feature
Milestone

Comments

@ofgulban
Copy link
Collaborator

ofgulban commented Feb 3, 2023

It seems that a voxel space based neighbor finder for irregularly spaced parcels might be a generally useful tool (suggested by @layerfMRI ). I am convinced that it might be useful especially to play along with LN2_COLUMNS, LN2_HEXBIN, and LN2_IFPOINTS programs.

@ofgulban ofgulban added this to the v2.4.0 milestone Feb 3, 2023
@ofgulban ofgulban changed the title Add 1st order neighbour finder program LN2_TETHER Add 1st order neighbour finder program LN2_NEIGHBOR Mar 21, 2023
ofgulban added a commit that referenced this issue Mar 21, 2023
@ofgulban
Copy link
Collaborator Author

ofgulban commented Mar 21, 2023

I have added LN2_NEIGHBORS program (currently experimental). This programs finds the first order neighbors of each unique label. Currently the output shows:

  Unique labels: [ 1 2 3 4 5 6 7 8 9 10 ]
  Number of unique labels: 10
  Start finding neighbors (3-jump neighbourhood)...
  Label 1 neighbors: 5 6 8 9 
  Label 2 neighbors: 6 7 
  Label 3 neighbors: 5 6 10 
  Label 4 neighbors: 7 8 9 
  Label 5 neighbors: 1 3 6 
  Label 6 neighbors: 1 2 3 5 7 8 10 
  Label 7 neighbors: 2 4 6 8 
  Label 8 neighbors: 1 4 6 7 9 
  Label 9 neighbors: 1 4 8 
  Label 10 neighbors: 3 6 

Probably, it would be best to export the information to a txt or csv file. @layerfMRI do you have any preferences?

ofgulban added a commit that referenced this issue Mar 23, 2023
@ofgulban ofgulban changed the title Add 1st order neighbour finder program LN2_NEIGHBOR Add 1st order neighbour finder program LN2_NEIGHBORS Mar 23, 2023
ofgulban added a commit that referenced this issue Mar 23, 2023
@ofgulban
Copy link
Collaborator Author

ofgulban commented Mar 23, 2023

@layerfMRI , the initial implementation is done. Give it a test ride and see how it feels.

I have decided to have the default output as a CSV file. This file is very lightweight and easy to load as a table in e.g. excel:
Screenshot_2023-03-23_19-52-34
Each label can have a varying amount of neighbors and this is expected.

In addition, I have added -export_nifti flag to give users the option to export the label neighborhood information voxel-by-voxel. This nifti runs the risk of being very large if one of the labels have substantially more neighbors than others. Therefore, this option is off by default.

@ofgulban ofgulban added the done Resolved issues that can be mentioned in the release notes. label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Resolved issues that can be mentioned in the release notes. new feature
Projects
None yet
Development

No branches or pull requests

1 participant