-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmainpage.dox
40 lines (30 loc) · 1.41 KB
/
mainpage.dox
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
/**
\mainpage CiftiLib
CiftiLib is a library for the CIFTI file format, as documented here: http://www.nitrc.org/projects/cifti/
It builds with either QT, or libxml++ and libboost-filesystem.
To use it, include CiftiFile.h, and use the CiftiFile class to read and write cifti files.
Reading example:
\code
CiftiFile myFile(filename);//defaults to reading data on demand
const CiftiXML& myXML = myFile.getCiftiXML();//mapping and dimension information
vector<float> rowData(myXML.getDimensionLength(CiftiXML::ALONG_ROW));//allocate array for row data
myFile.getRow(rowData.data(), 0);//read the first row
\endcode
Writing example:
\code
CiftiXML myXML;//first, need to set up the dimension mappings
CiftiScalarsMap exampleMap;
exampleMap.setLength(40);//just as an example
myXML.setNumberOfDimensions(2);//2D matrix
myXML.setMap(CiftiXML::ALONG_ROW, exampleMap);//set the mappings
myXML.setMap(CiftiXML::ALONG_COLUMN, exampleMap);
CiftiFile myFile;
myFile.setWritingFile(filename);//optional: write rows as they are set
myFile.setCiftiXML(myXML);//set the file's mappings
myFile.setRow(somedata, 0);//write a row
...
myFile.writeFile(filename);//if filename matches what was given to setWritingFile, this does nothing
\endcode
See rewrite.cxx for a program that does a row-by-row copy that works on cifti of any dimensionality.
See xmlinfo.cxx for a program that prints XML summary information of all dimensions of a cifti file.
*/