probmap.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __probmap_hh
#define __probmap_hh
#include <vector>
#include <string>
#include <map>
#include <iostream>
#include <mia/core/defines.hh>
typedef std::vector<double> double_vector;
NS_MIA_BEGIN
class EXPORT_CORE CProbabilityVector: public std::vector<double_vector>
{
public:
CProbabilityVector();
CProbabilityVector(size_t nClass, size_t nElm);
CProbabilityVector(const std::string& in_fname);
bool save(const std::string& out_fname) const;
private:
bool do_save(std::ostream& os) const;
void do_load(std::istream& is);
};
EXPORT_CORE bool operator == (const CProbabilityVector& a, const CProbabilityVector& b);
class EXPORT_CORE CLabelMap: public std::map<size_t, size_t>
{
public:
CLabelMap();
CLabelMap(const std::string& in_fname);
bool save(const std::string& out_fname)const ;
private:
bool do_save(std::ostream& os) const;
void do_load(std::istream& is);
};
EXPORT_CORE bool operator == (const CLabelMap& a, const CLabelMap& b);
NS_MIA_END
#endif
CLabelMap
A simple class to add loadind and storeing to a map of labels.
Definition core/labelmap.hh:37
CLabelMap::CLabelMap
CLabelMap(const std::string &in_fname)
CLabelMap::save
bool save(const std::string &out_fname) const
CLabelMap::CLabelMap
CLabelMap()
CProbabilityVector
A vector of probablility values.
Definition probmap.hh:44
CProbabilityVector::CProbabilityVector
CProbabilityVector(const std::string &in_fname)
CProbabilityVector::CProbabilityVector
CProbabilityVector()
CProbabilityVector::CProbabilityVector
CProbabilityVector(size_t nClass, size_t nElm)
CProbabilityVector::save
bool save(const std::string &out_fname) const
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
operator==
EXPORT_CORE bool operator==(const CProbabilityVector &a, const CProbabilityVector &b)
Compare two probability vectors.
double_vector
std::vector< double > double_vector
Definition probmap.hh:32