.\"                                      Hey, EMACS: -*- nroff -*-
.\" Copyright 1997 Peter Neelin, McConnell Brain Imaging Centre,
.\" Montreal Neurological Institute, McGill University.
.\" 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 and McGill University
.\" make no representations about the suitability of this
.\" software for any purpose.  It is provided "as is" without
.\" express or implied warranty.
.\"
.\" $Header: /private-cvsroot/minc/progs/mincmakescalar/mincmakescalar.man1,v 6.2 2004-05-20 21:52:08 bert Exp $
.\"
.TH MINCMAKESCALAR 1 "$Date: 2004-05-20 21:52:08 $" "" "MINC User's Guide"

.SH NAME
mincmakescalar - convert vector minc files to scalar

.SH SYNOPSIS
.B mincmakescalar
[<options>] <in>.mnc <out>.mnc

.SH DESCRIPTION 
.I Mincmakescalar
converts vector minc files to scalar minc files. A vector minc file is
one that contains the dimension  \fIvector_dimension\fR
as the fastest varying dimension of the image data and represents vector
data at each voxel such as RGB images or gradient volumes. A scalar
minc file does not contain the vector dimension and represents
grayscale or intensity data.

A variety of conversion schemes are possible. The simplest is an
average of the components of the vector. The magnitude of the vector
at each voxel can also be computed. RGB volumes can be converted to
greyscale by a standard linear combination. Finally, the user can
supply a list of coefficients for a linear combination of vector
components. 

Some options will require a specific number of components on the input
vectors (RGB data should have 3 components and the number of
coefficients supplied for the linear combination should match the
number of components on the input vectors), but the program will also
accept input scalar data and will copy it through without modification.

.SH OPTIONS
Note that options can be specified in abbreviated form (as long as
they are unique) and can be given anywhere on the command line.

.SH General options
.TP
\fB\-2\fR
Create a MINC 2.0 format output file.
.TP
\fB\-clobber\fR
Overwrite an existing file.
.TP
\fB\-noclobber\fR
Don't overwrite an existing file (default).
.TP
\fB\-no_clobber\fR
Synonym for \fB\-noclobber\fR.
.TP
\fB\-verbose\fR
Print out progress information for each chunk of data copied (default).
.TP
\fB\-quiet\fR
Do not print out progress information.
.TP
\fB-buffer_size\fR\ \fIsize\fR
Specify the maximum size of the internal buffers (in kbytes). Default
is 10 MB.
.TP
\fB\-filetype\fR
Create an output file with the same type as the first input file
(default).
.TP
\fB\-byte\fR
Store output voxels as 8-bit integers.
.TP
\fB\-short\fR
Store output voxels as 16-bit integers.
.TP
\fB\-int\fR
Store output voxels as 32-bit integers
.TP
\fB\-long\fR
Superseded by \fB\-int\fR.
.TP
\fB\-float\fR
Store output voxels as 32-bit floating point numbers.
.TP
\fB\-double\fR
Store output voxels as 64-bit floating point numbers.
.TP
\fB\-signed\fR
Create an output file with data stored in a signed type. This only
has an effect if the one of the \fB\-byte\fR, \fB\-short\fR or \fB\-int\fR
options is specified.
.TP
\fB\-unsigned\fR
Create an output file with data stored in an unsigned type. This only
has an effect if the one of the \fB\-byte\fR, \fB\-short\fR or \fB\-int\fR
options is specified.
.TP
\fB\-valid_range\fR\ \fImin\ max\fR
Create an output file with integer data stored in the specified
restricted range. 
This only has an effect if the one of the \fB\-byte\fR, \fB\-short\fR or
\fB\-int\fR options is specified.

.SH Conversion options
.TP
\fB\-magnitude\fR
Compute the magnitude of each vector (default).
.TP
\fB\-average\fR
Compute the average of the components of each vector.
.TP
\fB\-rgbtogrey\fR
Convert RGB (3-component) files to greyscale using a linear
combination with standard set of weighting coefficients.
.TP
\fB\-rgbtogray\fR
Synonym for \fB\-rgbtogrey\fR.
.TP
\fB\-linear\fR\ \fIc1,c2,c3,...\fR
Compute a linear combination of the components of each vector using
the specified coefficients (these weights must be given as a comma or
space-separated list of numbers in a single command-line
argument). The number of coefficients must match the number of
components on the input vectors.

.SH Generic options for all commands:
.TP
\fB-help\fR
Print summary of command-line options and exit.
.TP
\fB\-version\fR
Print the program's version number and exit.

.SH EXAMPLES

To convert an RGB file to an grayscale file:

   mincmakescalar -rgbtogrey rgb.mnc gray.mnc

To compute the gradient magnitude from a gradient volume

   mincmakescalar -magnitude gradient.mnc magnitude.mnc

To convert an RGB file to a grayscale file using a different set of
weighting factors for red, green and blue:

   mincmakescalar -linear '0.2,0.5,0.3' rgb.mnc gray.mnc

.SH AUTHOR
Peter Neelin

.SH COPYRIGHTS
Copyright \(co 1997 by Peter Neelin
