Advertisement
lubosvojtisek

Untitled

Jul 27th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.69 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <fstream>
  4. #include <cstring>
  5. using namespace std;
  6.  
  7. const int MAX_CHARS_PER_LINE = 512;
  8. const int MAX_TOKENS_PER_LINE = 20;
  9. const char* const IF_DELIMITER = " ";
  10. long pres = 314; // points in pulse
  11. static char pulse_filename[] = "ShalomRAFF";
  12. char file_str
  13. strcpy(file_name_str,pulse_filename);
  14. strcat(file_name_str,".pls");
  15.  
  16. int main()
  17. {  
  18.     string line;
  19.     ifstream prep_pulse_file;
  20.     prep_pulse_file.open(file_name_str);
  21.     if(prep_pulse_file.is_open())
  22.     {
  23.         while(prep_pulse_file.good())
  24.         {
  25.             getline(prep_pulse_file,line);
  26.             cout << line << endl;
  27.         }
  28.         prep_pulse_file.close();
  29.     }
  30.     return 0;
  31. }
  32. /*
  33. long pres = 314; // points in pulse
  34. static char filename[] = "ShalomRAFF";
  35. fSEQPrep {
  36. //-----------------------------------------
  37. // Prepare Multi Dimensional Tailored RF
  38. //-----------------------------------------
  39.  
  40. RFPFile *fid;
  41. double s_real = 0.0, s_imag = 0.0, ampint;
  42. int ii, nn;
  43. char str[50];
  44. strcpy(str,filename);
  45. strcat(str,".pls");
  46. fid=fopen(str,"rd");
  47. nn=fread(tmpmd,sizeof(float),pres,fid);
  48. fclose(fid);
  49. for (ii = 0; ii < pres; ii++)
  50. rfmd[ii].flPha = tmpmd[ii];
  51. strcpy(str,filename);
  52. strcat(str,".mag");
  53. fid=fopen(str,"r");
  54. nn=fread(tmpmd,sizeof(float),pres,fid);
  55. fclose(fid);
  56. for (ii = 0; ii < pres; ii++)
  57. rfmd[ii].flAbs = tmpmd[ii];
  58.  
  59. strcpy(str,filename);
  60. strcat(str,".gz");
  61. fid=fopen(str,"r");
  62. nn=fread(gxmd,sizeof(float),pres,fid);
  63. fclose(fid);
  64. strcpy(str,filename);
  65. strcat(str,".gx");
  66. fid=fopen(str,"r");
  67. nn=fread(gymd,sizeof(float),pres,fid);
  68. fclose(fid);
  69. strcpy(str,filename);
  70. strcat(str,".gy");
  71. fid=fopen(str,"r");
  72. nn=fread(gzmd,sizeof(float),pres,fid);
  73.  fclose(fid);
  74. // calculate amplitude integral
  75. for (ii = 0; ii < pres; ii++) {
  76. real+=rfmd[ii].flAbs*cos(rfmd[ii].flPha);
  77. imag+=rfmd[ii].flAbs*sin(rfmd[ii].flPha);
  78.  }
  79. ampint = sqrt(real*real + imag*imag);
  80. sRFMultiD.setFlipAngle(pMrProt->flipAngle());
  81. sRFMultiD.setInitialPhase(0);
  82. sRFMultiD.setThickness(pMrProt->sliceSerie().aFront().thickness());
  83. sRFMultiD.setDuration(pres*10);
  84. sRFMultiD.setTypeExcitation();
  85. sRFMultiD.setSamples(pres);
  86. sRFMultiD.prepArbitrarypMrProt,pSeqExpo,rfmd,ampint);
  87. sGxMultiD.setRampShape(gxmd,pres,0,1);
  88. sGxMultiD.setAmplitude(trfgamp);
  89. sGxMultiD.setRampUpTime(pres*10);
  90. sGxMultiD.setDuration(pres*10);
  91. sGxMultiD.prep();
  92. sGyMultiD.setRampShape(gymd,pres,0,1);
  93. sGyMultiD.setAmplitude(trfgamp);
  94. sGyMultiD.setRampUpTime(pres*10);
  95. sGyMultiD.setDuration(pres*10);
  96. sGyMultiD.prep();
  97. sGzMultiD.setRampShape(gzmd,pres,0,1);
  98. sGzMultiD.setAmplitude(trfgamp);
  99. sGzMultiD.setRampUpTime(pres*10);
  100. sGzMultiD.setDuration(pres*10);
  101. sGzMultiD.prep();
  102. } // end trf prep
  103.  }
  104.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement