NPL
Neurological Programs and Libraries
nplio.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2014 Micah C Chambers (micahc.vt@gmail.com)
3  *
4  * NPL is free software: you can redistribute it and/or modify it under the
5  * terms of the BSD 2-Clause License available in LICENSE or at
6  * http://opensource.org/licenses/BSD-2-Clause
7  *
8  * @file nplio.cpp Readers and Writers for npl::MRImage and npl::NDarray
9  *
10  *****************************************************************************/
11 #ifndef NPLIO_H
12 #define NPLIO_H
13 
14 #include "mrimage.h"
15 
16 namespace npl
17 {
18 
19 /******************************************************************************
20  * /addtogroup MRImageUtilities
21  * @{
22  *****************************************************************************/
23 
34 int writeMRImage(ptr<const MRImage> img, std::string fn, bool nifti2 = false);
35 
46 int writeNDArray(ptr<const NDArray> img, std::string fn, bool nifti2 = false);
47 
60 ptr<NDArray> readNDArray(std::string filename, bool verbose = false,
61  bool nopixeldata = false);
62 
77 ptr<MRImage> readMRImage(std::string filename, bool verbose = false,
78  bool nopixeldata = false);
79 
82 } // npl
83 
84 #endif //NPLIO_H
85 
int writeMRImage(ptr< const MRImage > img, std::string fn, bool nifti2=false)
Writes out an MRImage to the file fn. Bool indicates whether to use nifti2 (rather than nifti1) forma...
ptr< NDArray > readNDArray(std::string filename, bool verbose=false, bool nopixeldata=false)
Reads an array. Can read nifti's but orientation won't be read.
Definition: accessors.h:29
int writeNDArray(ptr< const NDArray > img, std::string fn, bool nifti2=false)
Writes out an MRImage to the file fn. Bool indicates whether to use nifti2 (rather than nifti1) forma...
ptr< MRImage > readMRImage(std::string filename, bool verbose=false, bool nopixeldata=false)
Reads an MRI image. Right now only nift images are supported. later on, it will try to load image usi...