Mercurial > hg > orthanc-java
comparison Samples/MammographyDeepLearning/src/main/java/Detection.java @ 28:43923934e934
added sample: deep learning for mammography
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Jun 2024 13:58:29 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:4a750ca9461e | 28:43923934e934 |
---|---|
1 /** | |
2 * SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium | |
3 * SPDX-License-Identifier: GPL-3.0-or-later | |
4 **/ | |
5 | |
6 /** | |
7 * Java plugin for Orthanc | |
8 * Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium | |
9 * | |
10 * This program is free software: you can redistribute it and/or | |
11 * modify it under the terms of the GNU General Public License as | |
12 * published by the Free Software Foundation, either version 3 of the | |
13 * License, or (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, but | |
16 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 * General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 **/ | |
23 | |
24 | |
25 import java.io.Serializable; | |
26 | |
27 class Detection implements Comparable<Detection>, Serializable { | |
28 private Rectangle rectangle; | |
29 private int label; | |
30 private double score; | |
31 | |
32 public Detection(Rectangle rectangle, | |
33 int label, | |
34 double score) { | |
35 this.rectangle = rectangle; | |
36 this.label = label; | |
37 this.score = score; | |
38 } | |
39 | |
40 public Rectangle getRectangle() { | |
41 return rectangle; | |
42 } | |
43 | |
44 public int getLabel() { | |
45 return label; | |
46 } | |
47 | |
48 public double getScore() { | |
49 return score; | |
50 } | |
51 | |
52 @Override | |
53 public int compareTo(Detection peak) { | |
54 return Double.compare(peak.score, score); | |
55 } | |
56 } |