ver. 221103
The Stereo MPI-RRIMs calculator is a set of simple programs that calculate RGB color values ofstereopaired morphometric protection index (MPI) red relief image maps (Stereo MPI-RRIMs; Kaneda &Chiba, 2019). The DEM visualization was refined from an original red relief image map (RRIM; Chiba et al.,2007; 2008) to better fit to active-fault and other geomorphological studies. Unlike most often used shaded
relief maps or slope maps, both of which only represent one aspect of topography, Stereo MPI-RRIMs allow
simultaneous expression of the three important aspects of three dimensional morphology (elevation, slope,
convexity/concavity) and would aid in more complete interpretation and mapping of small geomorphic featuresin the context of larger topography.
Password protection
Stereo MPI-RRIMs can be used only for academic purposes because RRIM visualization is a patentprotected (but open to academic use) technology of the Asia Air Survey Co., Ltd. in several countries (Japan,
USA, China, and Taiwan). Unzipping the downloaded calculator file thus requires a password, which isprovided on request by contacting Heitaro Kaneda at kaneda.00c at g.chuo-u.ac.jp (replace “at” with “@”).
Citation
If you publish your research that uses Stereo MPI-RRIMs visualization and/or our calculation programs,
please cite only one paper below:
Kaneda, H., and T. Chiba (2019), Stereopaired morphometric protection index red relief image maps
(Stereo MPI-RRIMs): effective visualization of high-resolution digital elevation models forinterpreting and mapping small tectonic geomorphic features, Bull. Seismol. Soc. Am., 109, 99–109.
https://doi.org/10.1785/0120180166
Hardware and software requirement(1) Windows or Windows environment in Mac. Mac version calculator is no longer available because ourcompiler in Mac environment has become out of service.
(2) 64 bit operating system (OS)(3) 8 GB or larger random access memory (RAM)- 4 GB or larger for just creating non-stereopaired MPI-RRIM(4) Sufficient disc space- preferably 20 GB or larger if you deal with very large DEMs of over 10,000 by 10,000 cells.
(5) Geographical information system (GIS) software such as QGIS or ArcGIS (QGIS is recommended
because it is simpler and faster).

1

Calculable data size
Because of memory (RAM) constraint, the program package is designed to handle DEMs up to 18,000
by 18,000 cells in size. A larger DEM needs to be split into small DEM tiles before calculation, although we
believe that the size limit is large enough in most cases. When you produce increased-resolution Stereo MPIRRIMs, the maximum DEM size is ~6000 by ~6000 cells.
GIS software version tested
As for GIS software, we tested QGIS 3.4.13 and ArcGIS (ArcMap) 10.4.1.
Contact Information
Please do not hesitate to contact us if you have any questions, problems, or comments in using our
calculation programs.
Heitaro Kaneda
Department of Civil and Environmental Engineering
Chuo University
1-13-27, Kasuga, Bunkyo-ku, Tokyo 112-8551, Japanemail：kaneda.00c at g.chuo-u.ac.jp (replace “at” with “@”).

2Calculation flow
The program package consists of two executable files. The MRRIMCAL executable file calculates color
values of an (non-stereopaired) MPI-RRIM from a DEM with ESRI ASCII raster format, and STEREOCAL
executable file calculates color values of Stereo MPI-RRIMs (for right and left eyes) from the output files of
MRRIMCAL. For closer examination of geomorphic features in a limited area, STEREOCAL has an optionof producing Stereo MPI-RRIMs with the increased resolution by a factor of three. The color value files canbe converted to tiff raster images by using GIS software such as QGIS or ArcGIS (use of QGIS is strongly
recommended because it is simpler and faster).

3

Step 1 Downloading and unzipping calculators
1-1 Download the calculator zip file from the web site below.
https://civil.r.chuo-u.ac.jp/lab/geology/5_mrrim/mrrim.html

1-2 Send an e-mail to kaneda.00c at g.chuo-u.ac.jp (replace “at” with “@”) with the information below andget a password.
(1) name(2) position(3) affiliation(4) purpose of using Stereo MPI-RRIMs calculator
1-3 Unzip the downloaded file with the password, and you will find a pair of executable files(MRRIMCAL_XX.exe and STEREOCAL_XX.exe; XX is version number) in “StereoMRRIMCAL”
folder.

Step 2 Preparing DEM
2-1 Prepare a DEM of an area of your interest and convert it to ESRI ASCII raster format with your GIS
software. Note that the DEM should be defined by Cartesian (x, y) coordinates in meters, notlatitude and longitude.

-

Open a new file. Drag and drop a DEM file of any format onto a main panel and open it.
Raster > Conversion > Translate (convert format)

4-On Translate (Convert Format) panel, choose the opened DEM file at Input layer menu.

-

Scroll down the panel, click “...” on the right of Converted menu, and choose “Save to File...”.

-On the save window, choose “ASC files (*.asc)” , input the file name, and save it at a proper
location.

ArcToolbox > Conversion toolbox > From Raster toolset > Raster to ASCII! A DEM larger than ~18,000 by ~18,000 cells needs to be split into small DEM tiles beforehand. See
p. 13 for details of DEM splitting.

2-2 Move the ASCII DEM file into “StereoMRRIMCAL” folder and rename it as “dem.txt.”! You need to change the extension to “.txt” if your DEM has the extension “.asc.”

5

Step 3 Calculation of MPI-RRIM (MRRIMCAL)
3-1 Double click MRRIMCAL_XX executable file. Command Prompt launches and begins to read theDEM. When finished (takes a while if the file is large in size), information of number of columns, numberof rows, and cell size appear along with the message “input calculation radius in number of cells (standard
value = 30).” Type calculation radius (try 30 cells if you have no preference) and hit Enter key.
! MRRIMCAL reads the text file named “dem.txt” in the folder in which MRRIMCAL.exe is present.
! Check the below items when the Command Prompt window erroneously closed.
When Command Prompt window erroneously closed… (MRRIMCAL)- make sure that your DEM file is named as dem.txt and saved in the folder in which MRRIMCAL
is present.
- make sure that RAM of your PC is ≥ 4 GB.
- make sure that there is enough disc space in your computer.
- make sure that your DEM is smaller than ~20,100 by ~20,100 cells in size.
- if the calculator does not work even though there is no problem in the above items, contact Heitaro
Kaneda at kaneda.00c at g.chuo-u.ac.jp (replace “at” with “@”) with your DEM text file.

3-2 The message “input gamma stretch value for MPI (black; standard value = 1.0)” appears. Type gamma
stretch value for morphometric protection index (MPI) (try 1 if you have no preference) and hit Enter key.
The message “input gamma stretch value for slope (red; standard value = 0.8)” follows. Type gamma
stretch value for slope (try 0.8 if you have no preference) and hit Enter key. The program starts calculation.

! Example of calculation time:
CPU: Intel Core i7-6600U 2.6 GHz (RAM: 16 GB)
4000 by 3000 cells, search radius = 30 cells: ~2.5 min
6000 by 6000 cells, search radius = 30 cells: ~8.5 min
18000 by 18000 cells, search radius = 30 cells: ~75 min! See p. 14 for details of gamma stretch values.
63-3 When finished, “Calculation completed” message appears along with calculation time, and you willfind the following four text files created in “StereoMRRIMCAL” folder:- mrrim_1r.txt: red color (R of RGB) value file of MPI-RRIM- mrrim_2g.txt: green color (G of RGB) value file of MPI-RRIM- demc.txt:
DEM file with search-radius margin eliminated- log_mrrimcal.txt: calculation log file with information of data size, cell size, calculation
parameters, start time, calculation time etc.
! There is no blue color (B of RGB) value file because G and B share a common value in MPI-RRIMs.
! The demc.txt is an intermediate product necessary for producing Stereo MPI-RRIMs.

Step 4 MPI-RRIM visualization and exportation with GIS software
You can visualize and export the created text files as an MPI-RRIM either with QGIS or ArcGIS (andprobably other GIS software). We recommend to use QGIS because the procedure is simpler and faster, andthe final product is a single tiff file with information of both coordinates and coordinate reference system (CRS)
incorporated, rather than tiff and world file (tfw) that lacks information of CRS.

4-Q1 You do not need to open any file beforehand.
- Raster > Miscellaneous > Build Virtual Raster…

-

On Build Virtual Raster panel, click “...” on the right of “Input layers” menu.

7-On Multiple selection panel, click “Add File(s)” and choose mrrim_1r.txt and mrrim_2g.txt
simultaneously using Shift key and open them. Make sure to check the two files and click OK.
3
2

1

-

Back to Build Virtual Raster panel (for unknown reason, Build Virtual Raster panel may have gone
behind the QGIS window). Check “Place each input file into a separate band” and click Run.

1

2

4-Q2 Yellowish image appears on the main panel. Close the Build Virtual Raster panel.
- On Layer Styling panel on the right, select “Band 2” on “Blue band” and “No Enhancement” on“Contrast enhancement.”8

! Shown is the raw MPI-RRIM calculated by the program. You can tune the colors of MPI-RRIM at
this step by using Layer Styling panel.
4-Q3 MPI-RRIM appears. Select “Virtual” on the Layers panel on the left and right click.
- > Export > Save As…

-

On Save as… panel,> check “Rendered image” radio button> select “Geo Tiff” on “Format”> select a proper location to save and type a file name (such as mrrim.tif)> click “OK”.

4-Q4 A single geotiff file is created.

4-A1 Drag and drop mrrim_1r.txt and mrrim_2g.txt onto ArcMap main panel. It takes a while and theimages of these two files appear.
4-A2 ArcToolbox > Data Management > Raster > Raster Processing > Composite BandsOn Composite Bands panel,> select mrrim_1r.txt, mrrim_2g.txt, and mrrim_2g.txt in this order on “Input Rasters”.
> select a proper location to save and type the file name such as “mrrim” on “Output Raster”> click “OK”.

9

4-A3 MPI-RRIM appears, but the color of this image has been automatically modified by the software.
Undo this color modification by right-clicking the MPI-RRIM file on the contents panel > Property> select “Symbology” tab > select “None” on “Type” and uncheck “Apply Gamma Stretch” in“Stretch” area.
! Shown is the raw M-RRIM calculated by the program. You can tune the colors of M-RRIM at thisstep by using “Symbology” tab.

4-A4 To make a general raster image such as tiff, right-click the MPI-RRIM file on the contents window> Data > Export Data > check “Use Renderer”, select a proper location to save, type a file name,select the format (such as TIFF) in the drop-down menu, and click “Save”.
4-A5 A tiff file is created together with the world (.tfw) file.
! You can directly produce tiff at Step 4-A2 by adding “.tif” extension to Output Raster file name, but forunknown reason, this produces tiff with a pixel depth of 32 bit rather than 8 bit, which is not friendly tomany environments. We therefore recommend the double-step procedure mentioned above.
! The MPI-RRIM file (ESRI GRID) produced at Step 4-A2 is no longer necessary when you successfully
produce tiff file.

10

Step 5 Calculation of Stereo MPI-RRIM (STEREOCAL)
5-1 Double click STEREOCAL_XX executable file. Command Prompt launches and begins to read theoutput files of Step 3 (mrrim_1r.txt, mrrim_2g.txt, and demc.txt). When finished (takes a while if the files
are large in size), information of number of columns, number of rows, and cell (grid) size appear alongwith the message “input zenith angle of view point in degree (0-90; standard value = 10).” Type zenith
angle (try 10 degrees if you have no preference) and hit Enter key.
! Note that the number of columns and rows are slightly smaller than those of the original DEM bytwice the search radius used to calculate the MPI-RRIM.
! STEREOCAL reads the text files named “mrrim_1r.txt”, “mrrim_2g.txt”, and “demc.txt” in the folder
in which STEREOCAL.exe is present.
! See p. 15 for details of zenith angle and viewpoint setting.
! Check the below items when the Command Prompt window erroneously closed.
When Command Prompt window erroneously closed… (STEREOCAL)- make sure that there exists “mrrim_1r.txt”, “mrrim_2g.txt”, and “demc.txt” in the folder inwhich STEREOCAL is present.
- make sure that RAM of your PC is ≥ 8 GB.
- make sure that there is enough disc space in your computer.
- make sure that your DEM is smaller than ~18,000 by ~18,000 cells in size
- if the calculator does not work even though there is no problem in the above items, contact Heitaro
Kaneda at kaneda.00c at g.chuo-u.ac.jp (replace “at” with “@”) with your DEM text files.
5-2 The message “input vertical exaggeration (standard value = 2)” appears. Type vertical exaggeration (try
2 if you have no preference) and hit Enter key.
5-3 If the number of columns and rows are both smaller than 6700, the message “create increased(triple)resolution Stereo MRRIMs? (y/n)” appears. Type “y” (yes) or “n” (no) (type “n” if you have nopreference) and hit Enter key. The program starts calculation. If the number of columns or rows is larger
than 6700, the program starts calculation without showing the above message.

11

! Example of calculation time:
CPU: Intel Core i7-6600U 2.6 GHz (RAM: 16 GB)
4000 by 3000 grids (or 1666 by 1000 grids with increased-resolution option): ~0.5 min
6000 by 6000 grids (or 2000 by 2000 grids with increased-resolution option): ~2.5 min
18000 by 18000 grids (or 6000 by 6000 grids with increased-resolution option): ~30 min
5-4 When finished, “Calculation completed” message appears along with calculation time, and you willfind the following five text files created in “StereoMRRIMCAL” folder:- smrrim_le_1r.txt: red color (R of RGB) value file of left-eye image of Stereo MPI-RRIMs- smrrim_le_2g.txt: green color (G of RGB) value file of left-eye image of Stereo MPI-RRIMs- smrrim_ri_1r.txt: red color (R of RGB) value file of right-eye image of Stereo MPI-RRIMs- smrrim_ri_2g.txt: green color (G of RGB) value file of right-eye image of Stereo MPI-RRIMs- log_stereocal.txt: calculation log file with information of data size, cell size, calculation parameters,
view-point altitude, start time, calculation time etc.
If you have chosen increased-resolution option, you will have the following seven files:- mrrim3_1r.txt: red color (R of RGB) value file of triple-resolution MPI-RRIM- mrrim3_2g.txt: green color (G of RGB) value file of triple-resolution MPI-RRIM- smrrim3_le_1r.txt: red color (R of RGB) value file of left-eye image of Stereo MPI-RRIMs- smrrim3_le_2g.txt: green color (G of RGB) value file of left-eye image of Stereo MPI-RRIMs- smrrim3_ri_1r.txt: red color (R of RGB) value file of right-eye image of Stereo MPI-RRIMs- smrrim3_ri_2g.txt: green color (G of RGB) value file of right-eye image of Stereo MPI-RRIMs- log_stereocal.txt: calculation log file with information of data size, cell size, calculation parameters,
view-point altitude, start time, calculation time etc.

Step 6. Stereo MPI-RRIM visualization and exportation with GIS software
6.1 Visualize the output files from STEREOCAL and export as tiff files by the same procedures described at
Step 4.
6.2 Delete all the text files in “StereoMRRIMCAL” folder.

! Stereo MPI-RRIMs have coordinates, but the locations are not strictly accurate because scales are notuniform in these images. The coordinates are given so that the lower-left (southwestern) corner of theimages coincide with that of the non-stereopaired MPI-RRIM.

12

Details of DEM splitting
In splitting a very large DEM into tiles that can be dealt with the calculator, you need to be aware that MPIRRIM produced from a DEM will be slightly smaller in area than the original DEM. This is because MPI-RRIM
production requires calculation of “wideness of sky” (morphometric protection index; MPI) within a given searchradius, and so MPI-RRIM cannot be produced where distance from a margin of the target area is smaller than the
search radius. For example, if you have a DEM of 4000 by 3000 cells and you set a search radius of 30 cells in
calculation, then you will have an M-RRIM with a size of 3940 by 2940 cells. For this reason, you need to split into
tiles that overlap by twice the search radius each other in order to produce MPI-RRIMs that collectively constitute a
seamless MPI-RRIM.

How to split a DEM into overlapping tiles

As far as we know, there is no tool in QGIS that allow splitting into overlapping rasters (gridSplitter plugin
does not support overlapping tiles). If you only use QGIS, manually clip a large DEM with Raster > Extraction> Clip Raster by extent.

ArcToolbox > Data Management > Raster > Raster Processing > Split Raster
On Split Raster panel> select a DEM you want to split on “Input Raster”> select a proper folder in which split DEMs are saved on “Output Folder”> type “Output Base Name”> select “SIZE_OF_TILE” on “Split Method”> type proper numbers on “X coordinate” and “Y coordinate” of “Size of Output Rasters (optional)”> click “Other Options”> type a proper number (= twice the search radius in grids) on “Overtlap (optional)”> select “PIXELS” on “Units (optional)> click “OK”.

13

Details of gamma stretch values
A gamma stretch value is an exponent for the conversion equation from MPI or slope parameters to integer
color values that range from 0 to 255 (gamma stretch value of 1 means a linear equation). In most cases, 1.0 and 0.8
should be appropriate. You can change these values when the produced MPI-RRIM turns out to be too thin- or thickcolored although colors can be tuned also at later step on GIS software. For both MPI (white-black) and slope (whitered), smaller gamma stretch values (< 1) lead to thicker-colored M-RRIMs whereas larger gamma stretch values (> 1)
produce thinner-colored images.

14

Details of zenith angle and viewpoint setting
A zenith angle is defined as an angle that a line from a viewpoint to the center of a target area makes with avertical line here. At the center of a target area, a parallax angle thus equals to twice the zenith angle. In
STEREOCAL, viewpoints are always set just above the center of the western and eastern edges of the target area,
so the height of the viewpoints depends on a width (lateral extent) of the target area and setting of a zenith angle. Incase of a zenith angle of 10 degrees, for example, viewpoint height is ~11,000 m (~11 km) when a width of thetarget area is 2000 m, and ~110,000 m (110 km) when the width is 20,000 m.

15

Appendix

How to view stereopaired images on a computer monitor
In order to take full advantage of Stereo MPI-RRIMs, we strongly recommend viewing the stereopaired
images on a computer monitor, preferably on a large one, by using software that allows to show, move, enlarge,
or reduce the two images simultaneously as well as a wearable or handheld stereoscope that supports stereoviewing on a large monitor.

SoftwareOur recommendation is free software “StereoPhoto Maker”, which is available at:
http://stereo.jpn.org/eng/stphmkr/index.html
Be sure to download “StereoPhoto Maker 64 bit” so that you can deal with very large stereopaired images.
Quick tour:
1) Launch StereoPhoto Maker.
2) File > Open Left/Right Images > select left and right images- it takes a while if the images are large in size, but once they are open, operations are relatively
smooth and fast.
3) Stereoscopically view the two images, preferably with a handheld stereoscope.
- if you view them with naked eyes, adjust the size of the StereoPhoto Maker window so that a
distance between the two images is 6–7 cm, a general distance between two eyes. There is noneed to do so if you can stereo-view by the cross method (see left and right images with yourright and left eyes, respectively).
- if the topography is flipped, exchange the two images by clicking Swap Left/Right icon.
4) Just enlarge and reduce the images with a mouse wheel, and move with a mouse as you like.
- As you enlarge images, you will have difficulty in stereo-viewing because of positional mismatch
between the images. When that happens, click Alignment Mode icon
(or ctrl + A) and locate
crosshairs at the same position in the both images.
16

- When the images are large in size, too much expansion causes very slow operation. The simplest
way to avoid this problem is to simply clip the area of your interest from the both images with
an image-editing software such as Photoshop, and reload and stereo-view the clipped images
with StereoPhoto Maker.

Stereoscope
We believe that the best one is Pocket 3Dvu of Berezin Stereo Photography Products. A pair of small
horizontal periscopes in this wearable stereoscope creates the situation in which the distance between your eyes
is virtually expanded, and so you can stereo-view the images even on a projection screen. Angle of mirrors in
the periscopes can be adjusted by an adjuster slider on the top of the device to fit to the monitor size and a
distance to the monitor. The viewer can be purchased from the web site below and costs 29.95 USD excluding
tax and shipping.
http://www.berezin.com/3d/pocket_3dvu.htm

17

Japanese users can also choose Stereo-mirror Viewer of Kokon Shoin Co. Ltd. This handheld
stereoscope has similar structure and mechanism to the Pocket 3Dvu but is not wearable and has a bit smaller
field of view. The Stereo-mirror Viewer costs 4000 JPY excluding tax and shipping and can be purchased onlyin Japan as the store does not ship abroad.
.

18