本文整理汇总了Java中org.scijava.module.MutableModuleItem类的典型用法代码示例。如果您正苦于以下问题:Java MutableModuleItem类的具体用法?Java MutableModuleItem怎么用?Java MutableModuleItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MutableModuleItem类属于org.scijava.module包,在下文中一共展示了MutableModuleItem类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rebuildSceneObjectChoiseList
import org.scijava.module.MutableModuleItem; //导入依赖的package包/类
private void rebuildSceneObjectChoiseList()
{
initializing = true;
sceneNodeChoices = new ArrayList<String>();
int count = 0;
for (Node sceneNode : sceneryService.getActiveSciView().getSceneNodes()) {
sceneNodeChoices.add(makeIdentifier(sceneNode, count));
count++;
}
MutableModuleItem<String> sceneNodeSelector = getInfo().getMutableInput("sceneNode", String.class);
sceneNodeSelector.setChoices(sceneNodeChoices);
//todo: if currentSceneNode is set, put it here as current item
sceneNodeSelector.setValue(this, sceneNodeChoices.get(sceneNodeChoices.size() - 1));
refreshSceneNodeInDialog();
initializing = false;
}
示例2: updateImagesToDisplay
import org.scijava.module.MutableModuleItem; //导入依赖的package包/类
private void updateImagesToDisplay(){
//System.out.println("imageToDisplayName " + imageToDisplayName );
List<String> nameList = new ArrayList<String>();
String[] imageNames = WindowManager.getImageTitles();
//System.out.println(ArrayUtils.toString(imageNames) );
int[] dims0 = imp0.getDimensions();
for(String imageName : imageNames){
ImagePlus impAux = WindowManager.getImage(imageName);
int[] dims = impAux.getDimensions();
//System.out.println(imageName+" : "+impAux.getTitle() );
//System.out.println(ArrayUtils.toString(dims) );
boolean isSizeEqual = true;
for(int d=0; d<dims.length; d++)
if( dims0[d]!=dims[d] )
isSizeEqual = false;
if( isSizeEqual ){
nameList.add(imageName);
}
}
nameList.add("None");
//nameList.add("Z");
//nameList.add("0");
if( impSegmentationDisplay != null){
if ( nameList.contains( impSegmentationDisplay.getTitle() ) ){
nameList.remove( impSegmentationDisplay.getTitle() );
}
}
int idx;
if( !nameList.contains(imageToDisplayName) ){
idx = nameList.indexOf("None");
}
else
idx = nameList.indexOf(imageToDisplayName);
final MutableModuleItem<String> imageToDisplayItem = getInfo().getMutableInput("imageToDisplayName", String.class);
imageToDisplayItem.setChoices( nameList );
//System.out.println("imageToDisplayName " + imageToDisplayName );
imageToDisplayItem.setValue(this, nameList.get(idx) );
//System.out.println("itemValue " + imageToDisplayItem.getValue(this) );
//System.out.println("imageToDisplayName " + imageToDisplayName );
//this.update( imageToDisplayItem , imageToDisplayName );
//this.updateInput( imageToDisplayItem );
}
示例3: computeDataMinMax
import org.scijava.module.MutableModuleItem; //导入依赖的package包/类
private void computeDataMinMax(
final RandomAccessibleInterval<? extends RealType<?>> img)
{
// FIXME: Reconcile this with DefaultDatasetView.autoscale(int). There is
// no reason to hardcode the usage of ComputeMinMax twice. Rather, there
// should be a single entry point for obtain the channel min/maxes from
// the metadata, and if they aren't there, then compute them. Probably
// Dataset (not DatasetView) is a good place for it, because it is metadata
// independent of the visualization settings.
DataRange range = autoscaleService.getDefaultRandomAccessRange(img);
dataMin = range.getMin();
dataMax = range.getMax();
final MutableModuleItem<Double> minItem =
getInfo().getMutableInput("min", Double.class);
minItem.setSoftMinimum(dataMin);
minItem.setSoftMaximum(dataMax);
final MutableModuleItem<Double> maxItem =
getInfo().getMutableInput("max", Double.class);
maxItem.setSoftMinimum(dataMin);
maxItem.setSoftMaximum(dataMax);
// System.out.println("IN HERE!!!!!!");
// System.out.println(" dataMin = " + dataMin);
// System.out.println(" dataMax = " + dataMax);
@SuppressWarnings({ "unchecked", "rawtypes" })
Iterable<T> iterable =
Views
.iterable((RandomAccessibleInterval<T>) (RandomAccessibleInterval) img);
BinMapper1d<T> mapper =
new Real1dBinMapper<T>(dataMin, dataMax, 256, false);
Histogram1d<T> histogram = new Histogram1d<T>(iterable, mapper);
if (bundle == null) {
bundle = new HistogramBundle(histogram);
}
else {
bundle.setHistogram(0, histogram);
}
bundle.setDataMinMax(dataMin, dataMax);
// bundle.setLineSlopeIntercept(1, 0);
log().debug(
"computeDataMinMax: dataMin=" + dataMin + ", dataMax=" + dataMax);
// force a widget refresh to see new Hist (and also fill min and max fields)
// NOPE. HistBundle is unchanged. Only internals are. So no
// refresh called. Note that I changed InteractiveCommand::update() to
// always setValue() and still this did not work. !!!! Huh?
// update(getInfo().getMutableInput("bundle", HistogramBundle.class),
// bundle);
// NOPE
// getInfo().getInput("bundle", HistogramBundle.class).setValue(this,
// bundle);
// NOPE
// getInfo().setVisible(false);
// getInfo().setVisible(true);
// NOPE
// getInfo().getMutableInput("bundle",HistogramBundle.class).initialize(this);
// NOPE
// getInfo().getMutableInput("bundle",HistogramBundle.class).callback(this);
}