2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------
28 // C++ Implementation: brukerobject
33 // Author: <Denis Grenier>, (C) 2008
35 // Copyright: See COPYING file that comes with this distribution
38 #include "brukerkspaceobject.h"
42 bool BrukerKspaceObject::FillWithObject(BrukerDataSet DataSet, int ObjectNumber)
45 std::string TempString;
46 std::vector< int > TempVectInt;
47 std::vector<double> TempVectDouble;
49 TempString="ACQ_abs_time";
50 if (DataSet.CheckExistKeyword(TempString)) {
51 setAbsoluteTimePosition ( DataSet.BrukerHeaderMap[TempString].GetIntValue()[0] );
55 TempString="ACQ_phase_factor";
56 if (DataSet.CheckExistKeyword(TempString)) {
57 setACQ_phase_factor(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
62 if (DataSet.CheckExistKeyword(TempString)) {
63 setDimension(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
67 TempString="ACQ_size";
68 if (DataSet.CheckExistKeyword(TempString)){
69 for (int i=0;i<getDimension();i++)
70 TempVectInt.push_back(DataSet.BrukerHeaderMap[TempString].GetIntValue()[i]);
71 setDimensionSizes(TempVectInt);
76 TempString="ACQ_flip_angle";
77 if (DataSet.CheckExistKeyword(TempString)){
78 setFlipAngle(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
83 if (DataSet.CheckExistKeyword(TempString)) {
84 if ( 1!=DataSet.BrukerHeaderMap[TempString].GetDimensionNumber())
86 for (int i=0;i<DataSet.BrukerHeaderMap[TempString].GetNumberOfElements();i++){
87 TempVectDouble.push_back(DataSet.BrukerHeaderMap[TempString].GetDoubleValue()[i]);
89 setFOV(TempVectDouble);
90 TempVectDouble.clear();
95 if (DataSet.CheckExistKeyword(TempString)){
96 setNA(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
101 if (DataSet.CheckExistKeyword(TempString)){
102 setNA(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
106 TempString="NSLICES";
107 if (DataSet.CheckExistKeyword(TempString)){
108 setNA(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
113 if (DataSet.CheckExistKeyword(TempString)){
114 setNI(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
119 if (DataSet.CheckExistKeyword(TempString)){
120 setNAE(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
125 if (DataSet.CheckExistKeyword(TempString)){
126 setDS(DataSet.BrukerHeaderMap[TempString].GetIntValue()[0]);
131 TempString="ACQ_ns_list";
132 if (DataSet.CheckExistKeyword(TempString)) {
133 for (int i=0;i<DataSet.BrukerHeaderMap[TempString].GetNumberOfElements();i++){
134 TempVectInt.push_back(DataSet.BrukerHeaderMap[TempString].GetIntValue()[i]);
136 setACQ_ns_list(TempVectInt);
141 TempString="ACQ_obj_order";
142 if (DataSet.CheckExistKeyword(TempString)) {
143 for (int i=0;i<DataSet.BrukerHeaderMap[TempString].GetNumberOfElements();i++){
144 TempVectInt.push_back(DataSet.BrukerHeaderMap[TempString].GetIntValue()[i]);
146 setACQ_obj_order(TempVectInt);
151 TempString="ACQ_echo_time";
152 if (DataSet.CheckExistKeyword(TempString)) {
153 for (int i=0;i<DataSet.BrukerHeaderMap[TempString].GetNumberOfElements();i++){
154 TempVectInt.push_back(DataSet.BrukerHeaderMap[TempString].GetIntValue()[i]);
156 setACQ_echo_time(TempVectInt);