[MINC-users] Maximum intensity projection

Andrew Janke a.janke at gmail.com
Wed Jun 13 22:00:44 EDT 2012


Hi Francois,

On 9 June 2012 01:36, francois hebert <francois.hebert007 at gmail.com> wrote:
> I would like to do a Maximum Intensity Projection in each orthogonal axis.
> Is there such tool in the minc library?

I know I'm late to party but for the dinosaurs amongst us who don't
always play with the new toys you could do this using the basic MINC
commands like this (via a perl script):

#! /usr/bin/env perl

use warnings "all";

# create tmp dir
$tmpdir = '/tmp/froogle';
&do_cmd('mkdir', '-p', $tmpdir);

# separate all the slices
for ($i=0; $i<100; $i++){
   &do_cmd('mincreshape', '-clobber',
           '-dimrange', "zspace=$i,0",
           $ARGV[0], "$tmpdir/$i-zslice.mnc");
   push(@files, "$tmpdir/$i-zslice.mnc");
   }

&do_cmd('mincmath', '-clobber', '-max', @files, @ARGV[1]);
&do_cmd('rm', '-rf', $tmpdir);

sub do_cmd {
   print STDOUT "@_\n";
   system(@_) == 0 or die;
   }

I will admit that doing this in pyminc is whole lot easier!

a


More information about the MINC-users mailing list