00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef RECOGRAPPA_H
00019 #define RECOGRAPPA_H
00020
00021
00022 #include "step.h"
00023 #include "measindex.h"
00024
00025
00026
00027
00028
00030
00031
00032
00033
00034 template<recoDim interpolDim, recoDim orthoDim, int interpolIndex, int orthoIndex, class Ignore=RecoDim<0> >
00035 class RecoGrappaWeights : public RecoStep {
00036
00037
00038 STD_string label() const {
00039 STD_string result="grappaweights";
00040 if(Ignore::dim()>0) result+="templ";
00041 if(interpolDim==line3d) result+="3d";
00042 return result;
00043 }
00044 STD_string description() const {return "Calculate GRAPPA weights in dimension '"+STD_string(recoDimLabel[interpolDim])+"' and post them on the blackboard with the label 'grappaweights_"+recoDimLabel[interpolDim]+"'.";}
00045 bool process(RecoData& rd, RecoController& controller);
00046 RecoCoord input_coord() const {return RecoCoord::coord_with_mode(RecoIndex::collected,channel,line3d,line,readout);}
00047 void modify_coord(RecoCoord& coord) const {}
00048 bool query(RecoQueryContext& context);
00049 RecoStep* allocate() const {return new RecoGrappaWeights;}
00050 void init();
00051
00052 JDXint reduction_factor;
00053 JDXint neighbours_read;
00054 JDXint neighbours_phase;
00055 JDXfloat svd_trunc;
00056 JDXfloat discard_level;
00057
00058
00059 ivector acl_lines(const RecoCoord& coord, int numof_neighb, int ired) const;
00060 bool calc_weights(ComplexData<5>& weights, const RecoCoord& trainingcoord, const ComplexData<4>& trainingdata);
00061
00062
00063
00064
00065
00066
00067 RecoMeasIndex<interpolDim, RecoDim<3, channel, freq, repetition>, RecoDim<1,orthoDim> > measlines;
00068
00069 };
00070
00071
00073
00074
00075 template<recoDim interpolDim, recoDim orthoDim, int interpolIndex, int orthoIndex>
00076 class RecoGrappa : public RecoStep {
00077
00078
00079 STD_string label() const {if(interpolDim==line3d) return "grappa3d"; else return "grappa";}
00080 STD_string description() const {return "Perform GRAPPA interpolation in dimension '"+STD_string(recoDimLabel[interpolDim])+"'";}
00081 bool process(RecoData& rd, RecoController& controller);
00082 RecoCoord input_coord() const {return RecoCoord::coord_with_mode(RecoIndex::collected,channel,line3d,line,readout);}
00083 void modify_coord(RecoCoord& coord) const {}
00084 bool query(RecoQueryContext& context);
00085 RecoStep* allocate() const {return new RecoGrappa;}
00086 void init();
00087
00088 JDXint reduction_factor;
00089 JDXbool keep_shape;
00090
00091
00092 int reduction_index(const ivector& indexvec, int sizePhase, int iphase) const;
00093 bool correct_shape(RecoData& rdkspace, const RecoController& controller) const;
00094
00095
00096
00097
00098
00099
00100 RecoMeasIndex<interpolDim, RecoDim<3, channel, freq, repetition>, RecoDim<1,orthoDim> > measlines;
00101
00102 };
00103
00104
00105
00106
00107 #endif
00108