]> Creatis software - creaBruker.git/blob - lib/src1/brukerimage.h
Feature #1792
[creaBruker.git] / lib / src1 / brukerimage.h
1 /*
2         # ---------------------------------------------------------------------
3         #
4         # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5         #                        pour la Santé)
6         # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7         # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8         # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9         #
10         #  This software is governed by the CeCILL-B license under French law and 
11         #  abiding by the rules of distribution of free software. You can  use, 
12         #  modify and/ or redistribute the software under the terms of the CeCILL-B 
13         #  license as circulated by CEA, CNRS and INRIA at the following URL 
14         #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
15         #  or in the file LICENSE.txt.
16         #
17         #  As a counterpart to the access to the source code and  rights to copy,
18         #  modify and redistribute granted by the license, users are provided only
19         #  with a limited warranty  and the software's author,  the holder of the
20         #  economic rights,  and the successive licensors  have only  limited
21         #  liability. 
22         #
23         #  The fact that you are presently reading this means that you have had
24         #  knowledge of the CeCILL-B license and that you accept its terms.
25         # ------------------------------------------------------------------------
26 */
27
28 //
29 // C++ Interface: brukerimage
30 //
31 // Description: 
32 //
33 //
34 // Author: Denis Grenier, (C) 2009
35 //
36 // Copyright: See COPYING file that comes with this distribution
37 //
38 //
39 #ifndef BRUKERIMAGE_H
40 #define BRUKERIMAGE_H
41
42 #include "brukerdataset.h"
43 #include "brukerSystem.h"
44 /**
45 This class centralizes the informations "needed" to exploit a bruker image file 2dseq
46
47         @author Denis Grenier
48         @file brukerimage.h
49 */
50 class creaBruker_EXPORT BrukerImage{
51 public:
52    BrukerImage(BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco);
53    ~BrukerImage();
54
55    bool Init(BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
56         
57    int                  getAbsoluteTimePosition()   const;
58    double               getRelativeTimePosition()   const;
59    const std::vector <int>    &getFOVpixels()       const;
60    const std::vector <double> &getFOVcm()           const;
61    double               getSliceThickness()         const;
62    double               getTE()                     const;
63    double               getTR()                     const;
64    double               getTI()                     const;
65    double               getFlipAngle()              const;
66    int                  getNA()                     const;
67    int                  getNR()                     const;
68    int                  getDS()                     const;
69    int                  getNAE()                    const;
70    int                  getACQ_phase_factor()       const;
71    std::string          getWordType()               const;
72    std::string          getImageType()              const;
73    const std::string   &getDataEndianness()         const;
74    size_t               getImageByteSize()          const;
75    size_t               getBeginingOfImageInBytes() const;
76    
77    const std::vector <int>    &getLoopStamp() const;
78
79    const std::vector<std::vector <double> >  &getRotationMatrixRPS2XYZ()    const;
80    const std::vector <double>                &getTranslationVectorRPS2XYZ() const;
81         
82         
83 protected:
84
85 private:
86
87 // on devrait plutot les nommer 'computeXXX' (setXXX est d'habitude reserve aux accesseurs 'publics')
88
89         bool setAbsoluteTimePosition    (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
90         bool setRelativeTimePosition    (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
91         bool setFOVpixels               (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
92         bool setFOVcm                   (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
93         bool setSliceThickness          (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
94         bool setTE                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
95         bool setTR                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
96         bool setTI                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
97         bool setFlipAngle               (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
98         bool setLoopStamp               (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
99         bool setNA                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
100         bool setNR                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
101         bool setNAE                     (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
102         bool setDS                      (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
103         bool setACQ_phase_factor        (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
104         bool setRotationMatrixRPS2XYZ   (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
105         bool setTranslationVectorRPS2XYZ(BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
106         bool setWordType                (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
107         bool setImageType               (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
108         bool setDataEndianness          (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
109         bool setImageByteSize           (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
110         bool setBeginingOfImageInBytes  (BrukerDataSet &TheOrigAcqp, BrukerDataSet &TheOrigReco, int TheValue);
111
112         std::vector<int>    FOVpixels;
113         std::vector<double> FOVcm;
114         std::vector<int>    LoopStamp;
115         double SliceThickness;
116         double TE;
117         double TR;
118         double TI;
119         double FlipAngle;
120         double RelativeTimePosition;
121         int NA;
122         int NR;
123         int NAE;
124         int DS;
125         int ACQ_phase_factor;
126         std::vector<std::vector<double> >  RotationMatrixRPS2XYZ;
127         std::vector<double>                TranslationVectorRPS2XYZ;
128         int  AbsoluteTimePosition;
129         std::string WordType;
130         std::string ImageType;
131         std::string DataEndianness;
132         size_t ImageByteSize;
133         size_t BeginingOfImageInBytes;
134
135 };
136
137 #endif