afids / afids-validator

Validator for the anatomical fiducial placement protocol
https://validator.afids.io
GNU General Public License v3.0
2 stars 4 forks source link

Validate given json object #8

Closed kaitj closed 5 years ago

tkkuehn commented 5 years ago

Just so I'm sure, for an AFIDs .fcsv file to be valid, it needs to meet the following requirements:

  1. Exactly 32 rows (not counting the three header rows)
  2. Each row's desc column (second last) contains the associated string in the protocol, after the number but before any equals sign, and with capitalized letters only in initialized landmark names.
  3. Each row has a real number in its x, y, and z (second, third, and fourth) columns.

@jclauneuro Can you confirm that these are each accurate and that I'm not missing anything?

jclauneuro commented 5 years ago

Flurry of activity today!

@tkkuehn: Yes, that's basically the essence of what we care about in the file (Markups fiducial file version ~= 4.6), but it may be worth also ensuring each of the 32 rows has 14 columns.

Also, I've noticed some raters sometimes submit files with the AFIDs out of order. This can be fixed post-hoc but probably better to establish good habits in trainees up front: i.e. ensuring that each AFID has been placed in ascending order (1,2,...,32). It would not be difficult to add a section to our tutorial that explains how to shift single markup points up or down.

tkkuehn commented 5 years ago

Perfect, thanks for the quick response. Just to reiterate for reference, I'll implement this checking the following requirements, and make sure that information about what's wrong is returned if the .fcsv is invalid:

  1. Markups fiducial file version >= 4.6 (< 5.0?) (I think this is just the version of 3D Slicer used to make the .fcsv, and I think it's safe (or at least the best we can do) to assume the format won't change in a minor version change)
  2. There are exactly 32 rows (excluding the three header rows).
  3. Each row has exactly 14 columns.
  4. Each row's desc column (second last) contains the associated string in the protocol, after the number but before any equals sign, and with capitalized letters only in initialized landmark names.
  5. Each row has a real number in its x, y, and z (second, third, and fourth) columns.
jclauneuro commented 5 years ago

Looks great! Nice to haves:

  1. Each AFID has been placed in ascending order, i.e. the labels go from 1,2,...,32
  2. For each row, the label:desc corresponds to the ground truth label:desc.