force endian of datatype example to make tests pass on bigendian systems
Tim Coalson
5 years ago
18 | 18 | if (argc < 3) |
19 | 19 | { |
20 | 20 | 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; | |
22 | 22 | return 1; |
23 | 23 | } |
24 | 24 | try |
25 | 25 | { |
26 | 26 | CiftiFile inputFile(argv[1]);//on-disk reading by default |
27 | 27 | 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 | |
29 | 29 | //otherwise, it will read and write one row at a time, using very little memory |
30 | 30 | //inputFile.setWritingDataTypeNoScaling(NIFTI_TYPE_FLOAT32);//this is how you would revert back to writing as float32 without rescaling |
31 | 31 | } catch (CiftiException& e) { |