openworm / tracker-commons

Compilation of information and code bases related to open-source trackers for C. elegans
11 stars 12 forks source link

Create a common set of example programs #141

Open Ichoran opened 7 years ago

Ichoran commented 7 years ago

Using the various WCON implementations would be easier if there were a set of example programs for each implementation showing how to accomplish various task. Here are a set of examples that can serve at least as ideas:

Basic WCON (all readers/writers)

  1. Read a file into memory and print out the number of animals in it.
  2. Read a file into memory, keep data from between 10 and 20 seconds, and write it out.
  3. Create a new fake data set of a worm translating in a circle, and write it out.
  4. Read a file into memory, discard all animals that move less than their minimum head-to-tail distance, and write it out.

Optional WCON (pick examples as supported by the reader/writer)

  1. Read a zip file into memory and print out the number of animals in it.
  2. Read an experiment split across three files and print out the number of unique animals.
  3. Read an experiment with a custom arena size, normalize so that the limits of the arena are +-1, and write out a new WCON file with the correct units.
  4. Define a custom feature that contains an array with a text string and a number, create a fake data set with that custom feature, write it out, and read it back again.
  5. Read a file with centroid data as well as spine data, compute the distance between centroid and spine for each animal, and print out the average.
  6. Read a file with centroid and perimeter data and for each animal print out the maximum distance between a perimeter point and the spine point closest to it.
  7. Read a file with heads and ventral sides in random orientation, fix them so heads are on the left while maintaining the correct side of the animal as ventral, and write the result.
  8. Scan a set of ten files and print out the names of those that contain animals less than 60 hours old at a temperature of 20C or below.

In order to make sure that these examples stay functional, they should be run during the test phase for each project and checked somehow (either externally, or by having every example contain an internal check--the latter is probably simpler to implement!).

cheelee commented 7 years ago

I think this can be made into a "beginner issue" someone with basic C/C++ skills can work on. Additionally the process of doing this can be documented and turned into a tutorial, which in turn can be a basis for earning a badge with us.

Ichoran commented 7 years ago

Yes, especially if we break it out by language, @cheelee. Tackling all languages at once is a tall order.