-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
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
- A reusable python module in it's own file is written
- The SlicerFiducials class is fully documented with docstrings that are sphinx compatible (see https://github.com/BRAINSia/BRAINSTools/blob/master/AutoWorkup/BAW/utilities/misc.py)
- Module is formatted with default
Blackformatting https://github.com/python/black - Class items have a test suite to verify that the operations are working correctly.
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() Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed