Blame view

src/proc/baseline.cpp 835 Bytes
5f3cba02   David Mayerich   initial public co...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  #include <iostream>
  #include <time.h>
  #include <thread>
  #include "stim/envi/envi_header.h"
  #include "stim/envi/bip.h"
  #include "stim/envi/bil.h"
  #include "stim/envi/bsq.h"
  #include "stim/envi/envi.h"
  
  void progress_thread_envi(stim::envi* e);
  extern stim::envi ENVI;
  
  
  //perform the appropriate baseline correction, depending on file type
  void baseline(std::string infile, std::string outfile, std::string headerfile, std::vector<double> points, unsigned char* mask){
  
  	std::cout<<"Performing linear baseline correction using "<<points.size()<<" points..."<<std::endl;
  	std::thread t1(progress_thread_envi, &ENVI);		//start the progress bar thread
  	ENVI.baseline(outfile,points, mask, true);		//perform baseline correction
  	//ENVI.close();
  
  	t1.join();									//wait for the progress bar thread to finish (it probably already is)
  
  
  }