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

Write re-usable .fcsv python class #32

Open
10 tasks done
hjmjohnson opened this issue May 21, 2019 · 0 comments
Open
10 tasks done

Write re-usable .fcsv python class #32

hjmjohnson opened this issue May 21, 2019 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@hjmjohnson
Copy link
Member

hjmjohnson commented May 21, 2019

As an Algortihm Developer,
I want to manipulate various .fcsv formats from python
so that a uniform API can be re-used for many purposes

Detailed Description

Generate a SlicerFiducials class to encapsulate the various common operations necessary for manipulating .fcsv files generated from the Slicer tools. Both historical and current .fcsv formats must be supported for reading and writing.

EXAMPLE_DIR='/Shared/sinapse/20190521_LandmarkIdentification/example'
OLD_FCSV='BCD_Original.fcsv'
NEW_FCSV='BCD_Original_markup.fcsv'
IMAGE='sub-XXXXX_ses-YYYYY_run-002_echo-1_T1w.nii.gz'

Tasks to be completed

  • Write a class that
  • can read (and autodetect) both the old and new formats
  • can write the landmark files in the new format
  • Class should be queryable for a single landmark physical point
  • if and the OPTIONAL image is given, query for a single landmark index location from that image
  • Given two landmark names, compute the Euclidean distance between those landmarks

Acceptance Criteria

Appendix

## Partial possible usecase
from slicerfiducials import SlicerFiducials

my_lmks_old = SlicerFiducials( 'BCD_Original.fcsv')
my_lmks_new = SlicerFiducials('BCD_Original_markup.fcsv', image='sub-XXXXX_ses-YYYYY_run-002_echo-1_T1w.nii.gz' )

## Compute IPD
ipd = my_lmks_old.euclidean_distance('RE','LE')

## compute difference between landmarks from two files
diff_lmks = SlicerFiducials.diff_files( my_lmks_old, my_lmks_new)

diff_lmks.Write('/tmp/diff.fcsv')

print(diff_lmks)

for name, point in my_lmks_new.iter():
    print(name)

## get a list of the landmark names
names =  my_lmks_new.names() 
@hjmjohnson hjmjohnson added the help wanted Extra attention is needed label May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants