//
// Dataset.java
//

/*
ImageJ software for multidimensional image processing and analysis.

Copyright (c) 2010, ImageJDev.org.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the names of the ImageJDev.org developers nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

package imagej.data;

import net.imglib2.img.ImgPlus;
import net.imglib2.meta.Metadata;
import net.imglib2.type.numeric.RealType;

/**
 * Dataset is the primary image data structure in ImageJ. A Dataset wraps an
 * ImgLib {@link ImgPlus}. It also provides a number of convenience methods,
 * such as the ability to access pixels on a plane-by-plane basis, and create
 * new Datasets of various types easily.
 * 
 * @author Curtis Rueden
 * @author Barry DeZonia
 */
public interface Dataset extends Data, Metadata {

	boolean isDirty();

	void setDirty(boolean value);

	ImgPlus<? extends RealType<?>> getImgPlus();

	void setImgPlus(final ImgPlus<? extends RealType<?>> imgPlus);

	/**
	 * gets a plane of data from the Dataset. The representation of the plane is
	 * determined by the native ImgLib container. This method will create a copy
	 * of the original data if it cannot obtain a direct reference.
	 */
	Object getPlane(final int planeNumber);

	/**
	 * gets a plane of data from the Dataset. The representation of the plane is
	 * determined by the native ImgLib container. The behavior of this method when
	 * a reference to the actual data cannot be obtained depends upon the value of
	 * the input copyOK boolean. If copyOK is true a copy of the data is created
	 * and returned. If copyOK is false null is returned.
	 */
	Object getPlane(final int planeNumber, boolean copyOK);

	void setPlane(final int no, final Object newPlane);

	RealType<?> getType();

	boolean isSigned();

	boolean isInteger();

	/** Gets a short string description of the dataset's pixel type. */
	String getTypeLabelShort();

	/** Gets the full string description of the dataset's pixel type. */
	String getTypeLabelLong();

	/** Creates a copy of the dataset. */
	Dataset duplicate();

	/** Creates a copy of the dataset, but without copying any pixel values. */
	Dataset duplicateBlank();

	/** Copies the dataset's pixels into the given target dataset. */
	void copyInto(final Dataset target);

	// TODO - eliminate legacy layer specific functionality in favor of a
	// generic properties system (setProperty(String, Object),
	// getProperty(String)) for storing arbitrary key/value pairs about the data.
	// The property system can be part of Data, and implemented in AbstractData.
	
	/**
	 * For use in legacy layer only, this flag allows the various legacy layer
	 * image translators to support color images correctly.
	 */
	void setRGBMerged(final boolean rgbMerged);

	/**
	 * For use in legacy layer only, this flag allows the various legacy layer
	 * image translators to support color images correctly.
	 */
	boolean isRGBMerged();

	void typeChange();

	void rgbChange();

	/**
	 * Changes a Dataset's internal data and metadata to match that from a given
	 * Dataset. Only its name stays the same. Written to allow nonplanar
	 * representations to copy data from other Datasets as needed to get around
	 * the fact that its data is not being shared by reference.
	 */
	void copyDataFrom(final Dataset other);

}

@@ -2140,16 +2140,29 @@
 data %7B%0A%0A
+%09/** TODO */%0A
 %09boolean
@@ -2170,24 +2170,37 @@
 isDirty();%0A%0A
+%09/** TODO */%0A
 %09void setDir
@@ -2219,16 +2219,29 @@
 alue);%0A%0A
+%09/** TODO */%0A
 %09ImgPlus
@@ -2275,24 +2275,37 @@
 ImgPlus();%0A%0A
+%09/** TODO */%0A
 %09void setImg
@@ -3065,24 +3065,37 @@
 n copyOK);%0A%0A
+%09/** TODO */%0A
 %09void setPla
@@ -3136,16 +3136,29 @@
 lane);%0A%0A
+%09/** TODO */%0A
 %09RealTyp
@@ -3170,24 +3170,37 @@
 getType();%0A%0A
+%09/** TODO */%0A
 %09boolean isS
@@ -3209,16 +3209,29 @@
 ned();%0A%0A
+%09/** TODO */%0A
 %09boolean
@@ -4359,24 +4359,37 @@
 BMerged();%0A%0A
+%09/** TODO */%0A
 %09void typeCh
@@ -4397,16 +4397,29 @@
 nge();%0A%0A
+%09/** TODO */%0A
 %09void rg

Add missing Javadoc stubs