Project

General

Profile

Start with existing CentOS installation » ex1.php

gd module testing script - Eric Hou, 03/08/2010 04:49 PM

 
<?php
if (!extension_loaded('mrc')) {
dl('mrc.so');
}
// --- Read a MRC file and display as a PNG
$filename="mymrc.mrc";
// --- create a mrc resource
$src_mrc = mrcread($filename);

// --- scale image :: average +/- n_stdev
$n_stdev = 3;
list($pmin, $pmax) = mrcstdevscale($src_mrc, $n_stdev);
$img = mrctoimage($src_mrc,$pmin,$pmax);

// --- create png image
header("Content-type: image/x-png");
imagepng($img);
// --- destroy resources in memory
mrcdestroy($src_mrc);
imagedestroy($img);
?>
(1-1/6)