/usr/bin/minchistory is in minc-tools 2.1.00-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | #! /usr/bin/env perl
#
# Simple script to dump history information from a minc file
#
# Copyright Andrew Janke a.janke@gmail.com
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies. The
# author makes no representations about the suitability of this software
# for any purpose. It is provided "as is" without express or implied warranty.
my($n_columns) = 80;
use strict;
use warnings "all";
use Getopt::Long;
use Pod::Usage;
use Text::Format;
use File::Basename;
my($me, %opt, $cmd_text, $text, $fname, $counter, @tmp, $c);
$me = &basename($0);
%opt = (
'help' => 0,
'man' => 0,
'verbose' => 0,
'error_string' => undef,
);
# Check arguments
&GetOptions(
'help|?' => \$opt{'help'},
'man' => \$opt{'man'},
'v|verbose' => \$opt{'verbose'},
'version' => sub { &print_version_info },
'e|error_string=s' => \$opt{'error_string'},
) or pod2usage(-verbose => 1) && exit;
# handle -man, -help or missing args
pod2usage(-verbose => 1) if $opt{'help'};
pod2usage(-exitstatus => 0, -verbose => 2) if $opt{'man'};
pod2usage(-verbose => 0) && exit if ($#ARGV < 0);
#$Usage = "Usage: $me <file1.mnc> [<file2.mnc> ... ]\n\n";
#die $Usage if ($#ARGV < 0);
# set up text objects
$text = new Text::Format( firstIndent => 0,
bodyIndent => 5,
columns => $n_columns );
$cmd_text = new Text::Format( firstIndent => 0,
bodyIndent => 5,
columns => ($n_columns - 2) );
# for each input file
foreach $fname (@ARGV){
if(!-e $fname){
warn "$me: Couldn't find $fname\n";
next;
}
print STDOUT $text->format("--- History of $fname ---\n");
$counter = 1;
foreach (`mincinfo -attvalue :history "$fname"`){
chomp;
next if $_ eq '';
# add the command number to the front
$_ = sprintf("[%02d] ", $counter ++) . $_;
# add \'s to the end of each line except the last
@tmp = split(/\n/, $cmd_text->format($_));
for($c=0; $c<$#tmp; $c++){
print STDOUT "$tmp[$c] \\\n";
}
print STDOUT "$tmp[$#tmp]\n";
}
print STDOUT "\n";
}
# print version information
sub print_version_info {
my $PACKAGE = 'minc';
my $VERSION = '2.1.00';
my $PACKAGE_BUGREPORT = 'Andrew Janke <a.janke@gmail.com>';
print STDOUT "\n$PACKAGE version $VERSION\n".
"Comments to $PACKAGE_BUGREPORT\n\n";
exit 0;
}
__END__
=head1 NAME
B<minchistory> - prints history information for minc files
=head1 SYNOPSIS
B<minchistory> [options] <file1.mnc> [<file2.mnc> ... ]
minchistory will dump the internal history of one or more MINC files
=head1 DESCRIPTION
B<minchistory> is a B<perl> script that prints the history
information in a collection of MINC files. Most MINC files contain an
internal "audit trail" that lists the commands used to create the
MINC file. This tool provides a convenient way to examine this information.
For each file, B<minchistory> prints a title line followed by a series of
lines which list the history information for that file.
--- History of <filename> ---
[01] Wed Oct 13 15:35:35 EST 2004>>>> dicom3_to_minc .
[02] Wed Oct 13 15:43:34 2004>>> mincreshape +direction \
bob-jones_256x256x256_T1.mnc out.mnc -dimorder zspace,yspace,xspace \
-clobber
B<minchistory> is essentially an alias for the following command with a bit
of pretty printing added.
mincinfo -attvalue :history B<filename.mnc>
=head1 OPTIONS
=over 4
=item B<-v>, B<--verbose>
Be noisy when doing things
=item B<--version>
Print version number and exit
=item B<-h>, B<--help>
Dump some quick help output
=item B<--man>
Dump a man page
=back
=head1 SEE ALSO
mincinfo(1)
=head1 AUTHOR
Andrew Janke - a.janke@gmail.com
=head1 COPYRIGHTS
Copyright 2000 by Andrew L Janke
=cuts
|