Developer documentation
Version 3.0.3-105-gd3941f44
mask.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __dwi_directions_mask_h__
18#define __dwi_directions_mask_h__
19
20
21#include <fstream>
22
23#include "misc/bitset.h"
24
25#include "dwi/directions/set.h"
26
27
28
29namespace MR {
30 namespace DWI {
31 namespace Directions {
32
33
34
35 class Mask : public BitSet { NOMEMALIGN
36
37 public:
38 Mask (const Set& master, const bool allocator = false) :
39 BitSet (master.size(), allocator),
40 dirs (&master) { }
41
42 Mask (const Mask& that) :
43 BitSet (that),
44 dirs (that.dirs) { }
45
46 const Set& get_dirs() const { return *dirs; }
47
48 void erode (const size_t iterations = 1);
49 void dilate (const size_t iterations = 1);
50
51 bool is_adjacent (const size_t) const;
52 size_t get_min_linkage (const Mask&);
53
54 private:
55 const Set* dirs;
56
57 };
58
59
60
61 }
62 }
63}
64
65#endif
a class for storing bitwise information
Definition: bitset.h:43
size_t size() const
the number of boolean elements in the set
Definition: bitset.h:120
void erode(const size_t iterations=1)
bool is_adjacent(const size_t) const
void dilate(const size_t iterations=1)
Mask(const Set &master, const bool allocator=false)
Definition: mask.h:38
Mask(const Mask &that)
Definition: mask.h:42
size_t get_min_linkage(const Mask &)
const Set & get_dirs() const
Definition: mask.h:46
#define NOMEMALIGN
Definition: memory.h:22
Definition: base.h:24