Codebase list ciftilib / 108ddc2
force endian of datatype example to make tests pass on bigendian systems Tim Coalson 5 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1818 if (argc < 3)
1919 {
2020 cout << "usage: " << argv[0] << " <input cifti> <output cifti>" << endl;
21 cout << " rewrite the input cifti file to the output filename, using uint8 and data scaling." << endl;
21 cout << " rewrite the input cifti file to the output filename, using uint8 and data scaling, little-endian." << endl;
2222 return 1;
2323 }
2424 try
2525 {
2626 CiftiFile inputFile(argv[1]);//on-disk reading by default
2727 inputFile.setWritingDataTypeAndScaling(NIFTI_TYPE_UINT8, -1.0, 6.0);//tells it to use this datatype to best represent this specified range of values [-1.0, 6.0] whenever this instance is written
28 inputFile.writeFile(argv[2]);//if this is the same filename as the input, CiftiFile actually detects this and reads the input into memory first
28 inputFile.writeFile(argv[2], CiftiVersion(), CiftiFile::LITTLE);//if this is the same filename as the input, CiftiFile actually detects this and reads the input into memory first
2929 //otherwise, it will read and write one row at a time, using very little memory
3030 //inputFile.setWritingDataTypeNoScaling(NIFTI_TYPE_FLOAT32);//this is how you would revert back to writing as float32 without rescaling
3131 } catch (CiftiException& e) {