//////////////////////////////////////////////////////////////////////////////////
//
// $Header:import.h$
// NAME:import
// BASE CLASSES:CDialog
// PURPOSE:This class is responsible for outputting slc file.
// $Log: $
////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "stdafx.h"
#include "Functions.h"
#include "Sar_CCDDoc.h"
#include "Sar_CCDView.h"
#include "afxwin.h"
#include "MemAlloc.h"
#include "afxcmn.h"
#include "Pgr.h"
#include "ReadFiles.h"
#define eps 1.E-15
#define INIT_MINMAX 1.E+30
#define ELEM_SWAP(a,b) { register float t=(a); (a)=(b); (b)=t; }
#define BANDS 1
#define INTERLEAVE_TYPE "bsq"
//defined these constats for envisat
#define MPH 1247 // Main Product Header
#define SPH 6099 // ASAR Image Products SPH
#define SQ 170 //SQ ADSRs
#define MPP 2009 //Main Processing Parameters
#define DCP 55 //doppler centroid parameers
#define CP 1483 //chirp parameters
#define ADSR1 521
#define ADSR 5731
#define new DEBUG_NEW
class import : public CDialog
{
DECLARE_DYNAMIC(import)
public:
import(CWnd* pParent = NULL); // standard constructor
virtual ~import();
// Dialog Data
enum { IDD = IDD_IMPORT_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
//Button Clicked Event for getting master image data file
afx_msg void OnBnClickedInpmaster();
//Button Clicked Event for getting slave image data file
afx_msg void OnBnClickedInpslave();
//Button clicked event for existing dilogue
afx_msg void OnBnClickedExit();
//Button clicked event for choosing ouput directory for slc file
afx_msg void OnBnClickedOutdir();
//Button clicked event which validates and triggers actual process
afx_msg void OnBnClickedBtnProcess();
//Check Button event for checking proper azimuth & range values
afx_msg void OnBnClickedCheckMlook();
//Dialog function for initialisation on dialog box
virtual BOOL OnInitDialog();
//later need to be removed
// afx_msg void OnBnClickedShimg();
//paint for all the paint activities
afx_msg void OnPaint();
//Function Process Master & slave Imagedata for ERS1/ERS2 & produces two slc files & two multilooked byte image file
void processERS_MasterSlave();
//Function Process Master & slave Imagedata for TERRASARX & produces two slc files & two multilooked byte image file
void processTERRA_MasterSlave();
//Converting an unsigned byte array to an integer.Used in case of terrasarx only.
int uchar_to_int(unsigned char b[]) ;
short int char_to_short(char b[]) ;
//Function Process Master & slave Imagedata for ALOS & produces two slc files & two multilooked byte image file
void processALOS_MasterSlave();
//Function Process Master & slave Imagedata for RADARSAT2 & produces two slc files & two multilooked byte image file
void processRSAT2_MasterSlave();
//Function used by rsat2 for locating image data
void read_tiff_strip(char *filename);
//Function Process Master & slave Imagedata for ENVISAT & produces two slc files & two multilooked byte image file
void processENSAT_MasterSlave();
//Function Process Master & slave Imagedata for COSMO-SkyMed & produces two slc files & two multilooked byte image file
void processCOSMO_MasterSlave();
//Function gets pointer to document object
CSar_CCDDoc* GetDocPtr();
//Creates Byte Image of multilooked slc image
void DoByteImage(char * outfilename,float **fin_data,int rr
,int cc);
//Function use in byte image calculation
void MinMaxContrastMedianBMP(float **mat,float *min,float *max
,int nlig,int ncol);
//function used in byte image calculation
float MedianArray(float arr[], int n);
//Used in allocating memory in case of byte image
float *vector_float(int nrh);
//Function used for creating header of images,for display purposes in envi or openev
void Create_Header(char *name,int rows,int col,int datatype,int bands,char *in_type);
//Function used for selecting appropriate process
void Select_process_func();
//function used for adding data file output name to parameter files required by next modules
void AddDataFileInfo(char*,char*,char*,int rows, int cols,char*,int,int);
//Used for validation of input by user
int validate_input(void);
//Set initial values when dialog visible on screen
void Set_Initial_Values();
//Used by all processing functions for converting slc file to multilooked slc file
void Multilook_SlcFile(int rows,int cols,int ncols,short bytes_per_pixel,
char* input_slcfile,char* output_bytefile,CPgr *);
//Displays byte image using openev
bool Display_ByteImage(char* master,char* slave);
//Called when display fails to display image
void Handle_Failed_Display(HINSTANCE hinst);
//create progressbar control
void create_progrcntl(CString header);
//Integer Showing for which satellite data processing will go
/*
ERS = 1
TerrasarX = 2
ALOS = 3
RadarSAt = 4
Envisat = 5
Cosmoskymed = 6
*/
int SelectedProcess;
//Both Values shows fully qualified path for master & slave imagedata
CString PathName1,PathName2;
//Takes input for master image file
CString led_input1;
//Takes input for slave image file
CString led_input2;
//Shows output directory for slc & byte image file
CString m_txtoutdir;
//Contains azimuth and range values for Image data processing
int azimuth,range;
//Control's value variable for taking azimuth input from dialog
CString m_azimuth;
//Control's value variable for taking range input from dialog
CString m_range;
//Checkbutton control value for diffrentiating between program fixed value & user entered value
CButton m_chk;
//Variables for handling timer activities
int nmax;
//Set this variable to true when process successfully completed otherwise false
bool flag;
//variables declared for holding values during processing of rsat2 data only.
int Nlig,Nstrip,Rstrip,Count,Value;
long unsigned int offset_strip,offset_strip_byte;
int *Strip_Offset,*Strip_Bytes;
//Set it to true when oninitdialog() successful.Its true value means drawing on dialog can go now.
bool flag_dialog;
//Used for retreiving parameter file name stored in document append.So in that files slc file name can be appended
//char *f1,*f2;
//control variable for azimuth
CSpinButtonCtrl m_spn_az;
//control variable for range
CSpinButtonCtrl m_spn_rn;
//pointer of type CFunctions used for accessing functions
CFunctions Pfun;
//Pointer to document used for accessing document object
CSar_CCDDoc *pdoc;
//Pointer of CMemalloc type used for memory allocation and deallocation function
CMemAlloc mem;
//for progressbar control
CPgr *pgr;
CReadFiles Pread;
afx_msg void OnDestroy();
virtual void PostNcDestroy();
CButton m_nextButton_import;
afx_msg void OnBnClickedNxtImport();
};
View count: 27