File: poolstudy.cpp

package info (click to toggle)
aeskulap 0.2.2-beta2%2Bgit20190406.ef77f01-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,736 kB
  • sloc: cpp: 9,213; ansic: 685; makefile: 330; sh: 256; xml: 101
file content (128 lines) | stat: -rw-r--r-- 2,716 bytes parent folder | download | duplicates (4)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
    Aeskulap ImagePool - DICOM abstraction library
    Copyright (C) 2005  Alexander Pipelka

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

    Alexander Pipelka
*/

#include "poolstudy.h"
#include "imagepool.h"
#include <iostream>

namespace ImagePool {

Study::Study() : 
m_max_series(0),
m_max_instances(0),
m_cur_instances(0) {
}

Study::Study(const std::string& studyinstanceuid) :
m_max_series(0),
m_max_instances(0),
m_cur_instances(0),
m_studyinstanceuid(studyinstanceuid) {
}

Study::~Study() {
	for(iterator i = begin(); i != end(); i++) {
		i->second.clear();
	}
	m_list.clear();
}

const std::string& Study::studyinstanceuid() {
	return m_studyinstanceuid;
}

const std::string& Study::patientsname() {
	return m_patientsname;
}

const std::string& Study::patientsbirthdate() {
	return m_patientsbirthdate;
}

const std::string& Study::studydescription() {
	return m_studydescription;
}

const std::string& Study::studydate() {
	return m_studydate;
}

const std::string& Study::studytime() {
	return m_studytime;
}

const std::string& Study::patientssex() {
	return m_patientssex;
}

void Study::set_instancecount(int cur, int max) {
	if(max != -1) {
		m_max_instances = max;
	}
	
	if(cur != -1) {
		m_cur_instances = cur;
	}
	
	//std::cout << "instances current: " << m_cur_instances << std::endl;
	//std::cout << "instances max: " << m_max_instances << std::endl;
}

int Study::get_instancecount() {
	return m_cur_instances;
}

void Study::emit_progress() {
	if(m_max_instances == 0) {
		return;
	}

	signal_progress((double)m_cur_instances / (double)m_max_instances);
}

const std::string& Study::server() {
	return m_server;
}

int Study::seriescount() {
	return m_max_series;
}

int Study::studyrelatedinstances() {
	return m_max_instances;
}

void Study::set_seriescount(int series) {
	m_max_series = series;
}

int Study::has_3d_information() {
	int c = 0;
	for(iterator i = begin(); i != end(); i++) {
		if(i->second->has_3d_information()) {
			c++;
		}
	}
	
	return c;
}

} // namespace ImagePool