#!/usr/bin/env perl # # Compute the volume at the vertices of the resampled cortical surfaces. # # Copyright Alan C. Evans # Professor of Neurology # McGill University # use strict; use warnings "all"; use Getopt::Tabular; use File::Basename; use File::Temp qw/ tempdir /; # --- set the help & usage strings --- my $help = < 1, CLEANUP => 1 ); # Invert transformation from stereotaxic to native space. my $inv_trans = "${tmpdir}/inv_trans.xfm"; &run( "xfminvert", $transform_xfm, $inv_trans ); # Transform resampled white/gray surfaces from stereotaxic to native space. my $white_native = "${tmpdir}/white_native.obj"; my $gray_native = "${tmpdir}/gray_native.obj"; &run( "transform_objects", $white, $inv_trans, $white_native ); &run( "transform_objects", $gray, $inv_trans, $gray_native ); unlink( $inv_trans ); # Compute volumes using resampled white/gray surfaces in native space. &run( "cortex_volume", "-zero", "-white", $white_native, "-gray", $gray_native, "-output", "${tmpdir}/rsl_native_volume.txt" ); unlink( $white_native ); unlink( $gray_native ); # Smooth the volumes on the stereotaxic model. &run( "depth_potential", "-smooth", $fwhm, "${tmpdir}/rsl_native_volume.txt", $model, $volume_file ); unlink( "${tmpdir}/rsl_native_volume.txt" ); #Execute a system call. sub run { system(@_)==0 or die "Command @_ failed with status: $?"; }