Click or drag to resize
XDL

XDMBandSetBandMin Method

영상 데이터 DN 최소값을 설정한다.(NullValue는 제외한다.)
영상의 데이터 타입이 Complex 타입일 경우, Complex output type에 해당하는 최소값을 설정한다.
Complex output type을 Magnitude로 설정하면 val값은 BandMin에 설정된다.
Complex output type을 Real, Imaginary, Phase중 하나로 설정하면 각 output type에 해당하는 최소값을 설정할 수 있다.

Namespace: Pixoneer.NXDL.NRS
Assembly: NXDLrs (in NXDLrs.dll) Version: 3.0.0.1
Syntax
C#
public void SetBandMin(
	double val,
	eComplexOutType type
)

Parameters

val  Double
영상 데이터 DN 최소값
type  eComplexOutType
Complex 데이터의 output type
Example
C#
string strError;
XRasterIO rasterIO = new XRasterIO();
if (rasterIO.Initialize(out strError) == false)
    return;

string strPath = @"F:\SAMPLE_IMAGE\ComplexData.tif";
XRSLoadFile xrsFile = rasterIO.LoadFile(strPath, out strError, false, eIOCreateXLDMode.All_NoMsg, false, 0, null);
if (xrsFile == null) return;

XDMComposite newComp = new XDMComposite();

newComp.Mode = eCompMode.Gray;
XDMBand band = xrsFile.GetBandAt(0);
XDMBand compBand = band;
if (Xfn.IsDataTypeComplex(band.DataType))
{
    XBandParamComplex paramComplex = new XBandParamComplex();
    paramComplex.OutputType = eComplexOutType.Real;
    paramComplex.SrcBand = band;

    XDMBandComplex bandComplex = new XDMBandComplex();
    if (bandComplex.SetInputParam(ref paramComplex))
    {
        // 헤더정보에는 Magnitude로 계산된 통계값이 기본으로 저장되어 있기 때문에 
        // output type이 Magnitude가 아닐 경우는 output type에 따라 통계값을 재설정해주어야 한다.
        // 안 할 경우, Magnitude의 통계치 값이 적용되어 그림이 어둡거나 밝게 나올 수 있다.
        double min = band.GetBandMin(paramComplex.OutputType);
        double max = band.GetBandMax(paramComplex.OutputType);
        double mean = band.GetBandMean(paramComplex.OutputType);
        double stddev = band.GetBandStdDev(paramComplex.OutputType);
        ulong[] histogram = band.GetHistogram(paramComplex.OutputType);

        bandComplex.SetBandMin(min, paramComplex.OutputType);
        bandComplex.SetBandMax(max, paramComplex.OutputType);
        bandComplex.SetBandMean(mean, paramComplex.OutputType);
        bandComplex.SetBandStdDev(stddev, paramComplex.OutputType);
        bandComplex.SetHistogram(histogram, paramComplex.OutputType);

        compBand = bandComplex;
    }
}
else
{
    compBand = band;
}

newComp.SetBand(ref compBand, 0);

newComp.SetCutType(eCompCutType.Ct98, 0);
newComp.SetStretchCoverage(eCompStretchCoverage.Band, 0);
newComp.SetStretchType(eCompStretchType.Linear, 0);
newComp.SetTransparentValue(0.0, 0);
newComp.ApplyTransparent = true;

nxImageLayerComposites.Lock();
// get XDMCompManager and reset list
XDMCompManager xdmCompManager = nxImageLayerComposites.GetXDMCompManager();
xdmCompManager.AddXDMComposite(ref newComp);
nxImageLayerComposites.UnLock();

nxImageLayerComposites.ZoomFit();
See Also