Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- const int MAX_CHARS_PER_LINE = 512;
- const int MAX_TOKENS_PER_LINE = 20;
- const char* const IF_DELIMITER = " ";
- long pres = 314; // points in pulse
- static char pulse_filename[] = "ShalomRAFF";
- char file_str
- strcpy(file_name_str,pulse_filename);
- strcat(file_name_str,".pls");
- int main()
- {
- string line;
- ifstream prep_pulse_file;
- prep_pulse_file.open(file_name_str);
- if(prep_pulse_file.is_open())
- {
- while(prep_pulse_file.good())
- {
- getline(prep_pulse_file,line);
- cout << line << endl;
- }
- prep_pulse_file.close();
- }
- return 0;
- }
- /*
- long pres = 314; // points in pulse
- static char filename[] = "ShalomRAFF";
- fSEQPrep {
- //-----------------------------------------
- // Prepare Multi Dimensional Tailored RF
- //-----------------------------------------
- RFPFile *fid;
- double s_real = 0.0, s_imag = 0.0, ampint;
- int ii, nn;
- char str[50];
- strcpy(str,filename);
- strcat(str,".pls");
- fid=fopen(str,"rd");
- nn=fread(tmpmd,sizeof(float),pres,fid);
- fclose(fid);
- for (ii = 0; ii < pres; ii++)
- rfmd[ii].flPha = tmpmd[ii];
- strcpy(str,filename);
- strcat(str,".mag");
- fid=fopen(str,"r");
- nn=fread(tmpmd,sizeof(float),pres,fid);
- fclose(fid);
- for (ii = 0; ii < pres; ii++)
- rfmd[ii].flAbs = tmpmd[ii];
- strcpy(str,filename);
- strcat(str,".gz");
- fid=fopen(str,"r");
- nn=fread(gxmd,sizeof(float),pres,fid);
- fclose(fid);
- strcpy(str,filename);
- strcat(str,".gx");
- fid=fopen(str,"r");
- nn=fread(gymd,sizeof(float),pres,fid);
- fclose(fid);
- strcpy(str,filename);
- strcat(str,".gy");
- fid=fopen(str,"r");
- nn=fread(gzmd,sizeof(float),pres,fid);
- fclose(fid);
- // calculate amplitude integral
- for (ii = 0; ii < pres; ii++) {
- real+=rfmd[ii].flAbs*cos(rfmd[ii].flPha);
- imag+=rfmd[ii].flAbs*sin(rfmd[ii].flPha);
- }
- ampint = sqrt(real*real + imag*imag);
- sRFMultiD.setFlipAngle(pMrProt->flipAngle());
- sRFMultiD.setInitialPhase(0);
- sRFMultiD.setThickness(pMrProt->sliceSerie().aFront().thickness());
- sRFMultiD.setDuration(pres*10);
- sRFMultiD.setTypeExcitation();
- sRFMultiD.setSamples(pres);
- sRFMultiD.prepArbitrarypMrProt,pSeqExpo,rfmd,ampint);
- sGxMultiD.setRampShape(gxmd,pres,0,1);
- sGxMultiD.setAmplitude(trfgamp);
- sGxMultiD.setRampUpTime(pres*10);
- sGxMultiD.setDuration(pres*10);
- sGxMultiD.prep();
- sGyMultiD.setRampShape(gymd,pres,0,1);
- sGyMultiD.setAmplitude(trfgamp);
- sGyMultiD.setRampUpTime(pres*10);
- sGyMultiD.setDuration(pres*10);
- sGyMultiD.prep();
- sGzMultiD.setRampShape(gzmd,pres,0,1);
- sGzMultiD.setAmplitude(trfgamp);
- sGzMultiD.setRampUpTime(pres*10);
- sGzMultiD.setDuration(pres*10);
- sGzMultiD.prep();
- } // end trf prep
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement