-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroi_definition.h
63 lines (43 loc) · 1.51 KB
/
roi_definition.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
54
55
56
57
58
59
60
61
62
63
//
// Created by giuseppe on 18/12/21.
//
#ifndef LUNGCANCERIDENTIFICATION_ROI_DEFINITION_H
#define LUNGCANCERIDENTIFICATION_ROI_DEFINITION_H
// The only Halide header file you need is Halide.h. It includes all of Halide.
#include "Halide.h"
#include "tools/halide_image_io.h"
//Include library to open/save images
#include <dcmtk/dcmimgle/dcmimage.h>
#include <dcmtk/dcmdata/dcdatset.h>
#include <dcmtk/dcmdata/dcfilefo.h>
#include <dcmtk/dcmdata/dcitem.h>
#include "dcmtk/dcmdata/dctk.h"
using namespace Halide;
using std::cout;
using std::cerr;
using std::endl;
class DisjointSet
{
std::unordered_map<int, int> parent;
public:
// perform MakeSet operation
void makeSet(std::vector<int> const &universe);
void add_element(int element);
void add_equivalence(int a, int b);
// find the root of the set in which element `k` belongs
int find(int k);
// Perform make_union of two subsets
void make_union(int a, int b);
bool is_root(int k);
};
int get_label(int a, int b, DisjointSet* ds);
Buffer<uint8_t> read_dicom_image(const char* filename);
Buffer<uint8_t> read_png_image(const char* filename);
Func mask (Func in, Buffer<uint8_t> mask);
Expr binarize (Func in, int threshold);
int get_otsu_treshold(Buffer<uint8_t> buffer);
void get_largest_cc(Buffer<uint8_t> buffer);
//TODO adjust background removal alogorithm
void background_removal(Buffer<uint8_t> mask);
int roi_definition(char* filename);
#endif //LUNGCANCERIDENTIFICATION_ROI_DEFINITION_H