Job Jar/Streamline boolean ROI selection program
This Job Jar task is to create a non-interactive command-line program that reads in a collection of streamlines, one or more regions of interest (ROIs; more on these below), and a description of boolean operations among the ROIs, and outputs the resulting subset of streamlines.
ROIs
An ROI is a binary partitioning of space: for a given ROI, every point in space either is in the ROI, or not in it. For example, you could specify an ROI as a cube with two corners at (0,0,0) and (1,1,1); every point inside the cube (including its boundary) is in the ROI; every other point is not in the ROI. Another example of an ROI specification is a binary mask, in which every point in a discretized space is labeled as either 0 (not in) or 1 (in).
A streamline for which any point on it is in a given ROI is said to "pass through" that ROI. What this program should do is create a collection of every streamline that passes through the specified ROIs according to the given boolean operations on them. For example, if the user specifies streamline set Q and the operation "ROI_A and not ROI_B", then the result should be all those streamlines in Q that pass through ROI_A and not ROI_B.
Command Line Options
The design of the command line options for this program will be very important. The Unix "find" utility has a simple syntax for specifying boolean operations as command-line arguments, but it can be unwieldy and has weird escaping problems. Another option might be to first specify the streamline collection, then a list of ROIs, and then a simple text string with boolean operations among the ROIs, which are named by the order in which they were specified; e.g. "(1 | 3) & !2".
ROIs are typically specified either as rectangular prisms (by the coordinates of two opposite corners), spheres (by a radius and the coordinates of the center), or binary masks (raster images in NIfTI format, in which each voxel has a value 0 [not in] or 1 [in]). One additional difficulty is that collections of masks are sometimes specified by indices in a raster image: a value of 0 means "not in any ROI", a value of 1 means "in ROI 1", a value of 2 means "in ROI 2", and so on.
Development Notes
For an initial version of this program, it would be sufficient to only support one type of ROI specification, as long as the software (and command-line interface) were designed for extensibility for future support of all others listed above.
Jadrian proposed this job and could collaborate to design the command line options.
Dependencies
This job depends on the completion of Job Jar/Streamline library.