-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzbb2FishImg.h
53 lines (43 loc) · 1.57 KB
/
zbb2FishImg.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include <fstream>
#include <cassert>
#include <string>
#include <vector>
#include<opencv2/core/core.hpp>
#include<opencv2/opencv.hpp>
#include<opencv2/highgui.hpp>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#define _USE_MATH_DEFINES
#include <math.h>
#define PI 3.1415926
#pragma once
class zbb2FishImg
{
public:
zbb2FishImg();
~zbb2FishImg();
cv::Rect Region;
std::vector<std::string> BrainRegionName;
std::vector<cv::Point3f> RegionCoord;
std::vector<std::vector<std::vector<std::string>>> zbbMapVec;
std::vector<float> zbb2FixAM;
std::vector<float> Fix2MovingAM;
cv::Point3f cropPoint;
Eigen::Matrix3f rotationMatrix;
std::vector<cv::Point2f> regionInFish; //to galvo
void initialize(std::string filename);
void getRegionFromUser(cv::Rect Reg);
void getZBB2FixAffineMatrix(std::vector<float> Fix2zbbAM);
void getFix2MovingAffineMatrix(std::vector<float> Moving2FixAM);
void getCropPoint(cv::Point3f pt);
void getRotationMatrix(float rotationAngleZ, float rotationAngleX);
std::vector<cv::Point2f> ZBB2FishTransform();
std::vector<std::pair<std::string, cv::Point>> readZBBMapFromTxt(std::string file);
std::vector<std::vector<std::vector<std::string>>> makeZbbMapVec(std::vector<std::pair<std::string, cv::Point>> zbbMapPair);
std::vector<std::string> queryRegionName(cv::Rect region);
void clear();
};
std::vector<float> inverseAffineMatrix(std::vector<float> am);
cv::Point3f applyAffineMatrixOn3DCoord(cv::Point3f temp, std::vector<float> am);
cv::Point3f applyRotationMatrixOn3DCoord(cv::Point3f temp, Eigen::Matrix3f rotationMatrix);