SciVis 2015 Project 2: "mapr"

Assigned Mon Jan 26; Due Wed Feb 4 at 11:59pm
(note non-canonical due date and time)

This project involves material covered in the class Jan 15 through Jan 27, the readings on colormaps assigned, and in (FSV) class notes Sections 1.0 through 1.10 (FSV Sections 4.3 and 4.4 are redundant with math covered on the board, but may be useful for reference; they were not assigned because they different variable naming than everything else we've done). The basic goal of this project is to generalize to two dimensions the abstraction implemented in the first project: a continuous field (reconstructed by convolution with discretely sampled data) that may be evaluated and differentiated at arbitrary points in world-space. We also include colormapping, shading (based on the gradient), and 2-D isocontouring via "Marching Squares". In the end you will have a utility that can create nice shaded topographic maps as EPS files.

Logistics

Your CNETID-scivis-2015 directory should now be populated with a p2mapr directory which contains all the files for this project. As long as you have environment variable $SCIVIS set correctly, and if you are logged into one of the CSIL Macs, you should be able to type make in p2mapr to build a mapr executable. You should also have a reference executable rmapr which you should use for comparison and debugging. You can work individually or in pairs for this project; see the information in the Logistics section of the Project 1 page for details; you should see a "Project 2: mapr (p2mapr)" assignment for which you can create a work group. If you pair up with the same partner as in a previous assignment, you will be re-using the previously created repository.

What to do

As in the first project, the specification of what to do lies mainly within the given source files, and reference executable rmapr. As before, run "./rmapr" to review the commands available, and run "./rmapr about" the functions that will need to be implemented. For each of the mapr X commands corresponding to work you have to do, you should carefully read the usage information (generated by "./mapr X") to make sure you understand the purpose of the command and the meaning of its command-line options. Scrutinizing the implementation of the command (in mapr_X.c) may also be informative.

In the definition of functions that you have to implement, you will see lines:

/* v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v  begin student code */
/* ^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^  end student code */
DO NOT EDIT THESE LINES (the ones with v.v.v.v and ^'^'^'^'^), or anything outside the regions that they delineate. For this project there aren't blank lines that indicate the number of lines in the reference implementation, to ensure that you can think freely about what is needed for the project and how to create it.

For this project, you should may also edit the header file (mpr.h) to augment the definition of the mprContext struct, to include resources (buffers) or state that you want to set on a per-image or per-kernel basis, independent of where the convolution is being evaluated. Resources allocated in mprContextNew should be cleaned up in mprContextNix. Thus, your implementation of mprConvoEval will involve making multiple coordinate changes to multiple files, unlike the more strictly sequential nature of work in the first project. In some source files you may also add new functions, but these must be static functions (only for use within that source file). As before, you may not create new source files, or edit the Makefile.

You are responsible for reading through mpr.h to understand what functions are defined where, and reading through mprMath.h to see what matrix-related macros are available for use.

At the start of the functions that you have to implement, there is a comment block that defines what the inputs and outputs to the function should be; this provides the technical definition of what a correct implementation should be. The reference implementation rmapr should conform to this.

The implementation of mprPictureSample() (given to you) may be especially informative to read through. It shows how:

mprPictureEval() is also good to understand, since it shows the context of calling mprPictureRGB(), which you have to implement.

For 33710 students

For this project there is some additional work for 33710 students to do relative to 23710 students (although in reality it more like some of the original expectations are not required for 23710):

Example mapr/rmapr commands to try

The commands here use "./rmapr"; you should make sure that you get the exactly same results by running "./mapr". There is new data in the scivis-2015 repository, which below will be referred to below as "$SCIVIS", in the data/2d subdirectory. Read the 00-info.txt file there to see a description of the datasets useful for this project. There are also (as of Jan 30) some sample colormaps in the cmap directory.

Grading

The grade will be based on correctness (80%) and style (20%). If your code does not compile cleanly, with the Makefile provided, you will get a ZERO for correctness. Correctness will be evaluated with examples such as those above, and maybe some additional ones to test corner cases. For the style points, keep in mind: