Trying more to do the crop.
var cropped1 = new Image( targetRect.width, targetRect.height, image1.numberOfChannels, image1.colorSpace );
image1.selectedRect = targetRect;
cropped1.apply( image1);
ShowIntermediateResult(cropped1, 'MCDD_C1');
function ShowIntermediateResult(image, name)
{
var resultWindow = new ImageWindow( image.width, image.height, // width, height
1, image.bitsPerSample, // channels, bits per sample
image.sampleType == SampleType_Real, // float sample
false, // true=RGB, false=grayscale
name ); // your unique identifier
var resultView = resultWindow.mainView;
with ( resultView )
{
beginProcess( UndoFlag_NoSwapFile );
image.assign( image ); // assign the first image
endProcess();
}
resultWindow.show();
resultWindow.zoomToOptimalFit();
}
However the result is pathetic. The size is correct, but the image is largely black, with 0 or very large negative numbers. The original images are 16 bits grayscale (flats). Rectangle is [590.000000,462.000000,690.000000,562.000000], and the source image large enough. After a few tests, pixinsight crashes.
-- bitli