Skip to content
Snippets Groups Projects
Commit 241a116d authored by Matthew Webster's avatar Matthew Webster
Browse files

removed old 0,0,0 behaviour as nonsensical

parent 46437f42
No related branches found
No related tags found
No related merge requests found
// fslcreatehd.cc - Copy certain parts of an AVW header
// Mark Jenkinson, Steve Smith and Matthew Webster, FMRIB Image Analysis Group
// Copyright (C) 2001-2005 University of Oxford
// Copyright (C) 2001-2018 University of Oxford
// CCOPYRIGHT
#include "newimage/newimageall.h"
......@@ -15,9 +15,9 @@ void print_usage(const string& progname)
cout << "Usage: fslcreatehd <xsize> <ysize> <zsize> <tsize> <xvoxsize> <yvoxsize> <zvoxsize> <tr> <xorigin> <yorigin> <zorigin> <datatype> <headername>" << endl;
cout << " fslcreatehd <nifti_xml_file> <headername>" << endl;
cout << " Datatype values: " << DT_UNSIGNED_CHAR << "=char, " << DT_SIGNED_SHORT << "=short, " << DT_SIGNED_INT <<"=int, " << DT_FLOAT << "=float, " << DT_DOUBLE<< "=double" << endl;
cout << " In the first form, a radiological image will be created, the origin being given as voxel co-ordindates," << endl;
cout << " if the output file already exists, its data ( but not geometric information ) will be copied if it has" << endl;
cout << " a matching number of elements."
cout << " In the first form, a radiological image will be created, with the origin input as a voxel co-ordinate." << endl;
cout << " If the output file already exists, its data ( but not geometric information ) will be copied if it has" << endl;
cout << " a matching number of elements." << endl;
cout << " In the second form, an XML-ish form of nifti header is read (as output by fslhd -x)" << endl;
cout << " Note that stdin is used if '-' is used in place of a filename" << endl;
......@@ -57,16 +57,16 @@ int fslcreatehd_main(int argc, char *argv[])
header.dim[i]=atoi(argv[i]);
for (int i=1;i<=4;i++)
header.pixdim[i]=atof(argv[i+4]);
if ( atoi(argv[9]) != 0 || atoi(argv[10]) != 0 || atoi(argv[11]) != 0 ) {
header.sformCode=2;
header.sX[0]=-header.pixdim[1];
header.sY[1]=header.pixdim[2];
header.sZ[2]=header.pixdim[3];
header.sX[3]=-header.pixdim[1]*(header.dim[1]-1.0-atoi(argv[9]));
header.sX[3]=header.pixdim[1]*(header.dim[1]-1.0-atoi(argv[9]));
header.sY[3]=-header.pixdim[2]*atoi(argv[10]);
header.sZ[3]=-header.pixdim[3]*atoi(argv[11]);
}
header.qformCode=2;
header.setQForm(header.getSForm());
} else {
/* read XML form */
char *newstr, *oldfname, *oldiname;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment