SizeDescriptor.java
Go to the documentation of this file.00001 package theba.descriptors;
00002
00003 import theba.core.RegionDescriptor;
00004 import theba.core.RegionMask;
00005
00006 public class SizeDescriptor implements RegionDescriptor {
00007
00008 public Object measure(RegionMask mask) {
00009 long size = 0;
00010 for (int x = 0; x < mask.getWidth(); x++)
00011 for (int y = 0; y < mask.getHeight(); y++)
00012 for (int z = 0; z < mask.getDepth(); z++)
00013 if (mask.isSet(x, y, z))
00014 size++;
00015
00016 return size;
00017 }
00018
00019 public String getName() {
00020 return "Size (3D)";
00021 }
00022
00023 public String getAbout() {
00024 return "The size of this region in pixels";
00025 }
00026
00027 public boolean does3D() {
00028 return true;
00029 }
00030
00031 public boolean isNumeric() {
00032 return true;
00033 }
00034
00035 }