Initialization
This section introduces how to initialize and finalize ImageDev.
Syntax
// ImageDev library initialization imagedev::init();
// Check initialization if( imagedev::isInitialized() ) { std::cout << "ImageDev is initialized" << std::endl;
// Open a tif file auto imageInput = ioformat::readImage(std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "hello_imagedev.tif");
// Apply a normalization of its graylevels using function coding style std::shared_ptr < iolink::ImageView > imageNorm = imagedev::rescaleIntensity(imageInput, imagedev::RescaleIntensity::OutputType::SAME_AS_INPUT, imagedev::RescaleIntensity::RangeMode::PERCENTILE, { 2, 98 }, { 0, 255 }, { 0, 255 });
// ImageDev library finalization imagedev::finish(); }
# ImageDev library initialization # Open and display a tif file image_input = ioformat.read_image(imagedev_data.get_image_path("hello_imagedev.tif"))
# Apply a normalization of its graylevels using function coding style image_norm = imagedev.rescale_intensity(image_input, range_mode=imagedev.RescaleIntensity.RangeMode.PERCENTILE) imagedev.imshow(image_norm)
// ImageDev library initialization Initialization.Init();
if (Initialization.IsInitialized() == true) { // Open a tif file ImageView imageInput = IOFormat.ViewIO.ReadImage(@"Data/images/hello_imagedev.tif") as ImageView; try { // Apply a normalization of its graylevels using function coding style var imageNorm = Processing.RescaleIntensity(imageInput, RescaleIntensity.OutputType.SAME_AS_INPUT, RescaleIntensity.RangeMode.MIN_MAX, new double[] { 2, 98 }, new double[] { 0, 255 }, new double[] { 0, 255 }); // Notify the garbage collector that the intermediate image can be freed imageNorm.Dispose(); } catch { Utilities.WriteErrorMsg("RescaleIntensity function failed!"); } }