Nifti and Dicom support example.
#include <iostream>
using namespace std;
int main()
{
cout << "Reading a nifti Image" << endl;
if (!
NiftiRead(
"../examples/data/nifti/LR_nifti.nii", nifti_image)) {
return EXIT_FAILURE;
}
int gamma = 3;
cout << "Executing GammaContrast" << endl;
cout << "Save a nifti Image" << endl;
cout << "Reading a dicom Image" << endl;
if (!
DicomRead(
"../examples/data/dicom/ISIC_0000008.dcm", dicom_image)) {
return EXIT_FAILURE;
}
cout << "Executing ChangeColorSpace" << endl;
cout << "Executing OtsuThreshold" << endl;
double maxval = 255;
cout << "Executing Threshold" << endl;
Threshold(dicom_image, dicom_image, thresh, maxval);
cout << "Save a dicom Image" << endl;
if (!
ImRead(
"../examples/data/test.jpg", img)) {
return EXIT_FAILURE;
}
cout << "Save a nifti from .jpg Image" << endl;
cout << "Save a dicom from .jpg Image" << endl;
return EXIT_SUCCESS;
}