SciVis 2017 Project 2: "mapr"

Assigned Sun Jan 15; Due Thu Jan 26 at 9:00pm

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. The only kind of image that you'll have to handle a 1-channel (gray-scale) image of floats. 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.

Getting Started

You can work individually or in pairs for this project. All individual CNETID-scivis-2017 directories should now be populated with a p2mapr directory containing the files for this project. Use to work with another student (our class will be identified as 23710 even for 33710 students). Once the joint repository is created for your work together on a project, that project directory in your individual repository will be ignored by graders. If you partnered with the same person for previous project, you will re-use the same pair repository created then. If you are able to create a pair repo, but it is not seeded with the p2mapr files, ask a question in the p2mapr folder on Piazza.

What to do

Structurally, this is set up like the previous project. The specification of what to do lies mainly within the given source files, and executable mapr. Run "./rmapr" to review the commands available, and run "./rmapr about" to see the structs to finish defining, and the functions to implement. You may add code within indicated student code blocks. Read the comment blocks above the functions you finish implementing to understand the technical definition of what a correct implementation should do. The reference implementation rmapr should conform to this. For each of the mapr X commands corresponding to work you have to do, carefully read the usage information (generated by "./mapr X") to understand the purpose of the command and the meaning of its command-line options. You may not create new source files; grading will be done with the distributed Makefile,, and files.

Unlike in the first project, you 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 all the .c files that you may edit, you may add new #define macros or new functions, but they should be static functions (only for use within that source file).

Here is a prioritized listing of the source files involved:

All together, about 380 lines were stripped from the reference solution to generate the student code. As before, do not take too seriously the comments about how many lines were in the reference version of a student code block; they are only for rough guidance.

The code for mprPictureSample() in picture.c may be especially informative to read through. It shows how:

mprPictureEval() in picture.c 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:

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". NOTE: There are new files for this project in the scivis-2017 repository, which below will be referred to below as "$SCIVIS". There are sample datasets in data/2d (see the 00-info.txt there for details) and sample colormaps in cmap.


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