新しいアイデアが浮かばない日が数日あるので、あなたに話したい問題があります。
double* ポインターでポイントされた画像があり、それを itk::smartpointer に変換してユーザー グラフィック インターフェイスを更新したいので、この目的のために次のメソッドを作成しました。
void prueba_r01::double2itk( double *im_proc, ImageType::Pointer *salida, int alto, int ancho)
// This method translate the double* image into itk:smartpointer image
ImageType::IndexType pixelIndex; // pixelIndex[0]= index x-axis; pixelIndex[1] = index y-axisy
ImageType::PixelType pixelValue;
ImageType::PixelType aux; //auxiliar variable for checking the behaviour of the programm
// Doing a sweep of all the image (is in double *im_proc) translating the values into itk pointer format
for (int x=0; x<ancho; x++){ // ancho: widht of the image
pixelIndex[0]=x;//x position
for (int y=0; y<alto; y++){ // alto: height of the image
pixelIndex[1]=y;//y position
pixelValue= *(im_proc+x+ancho*y);
(*salida)->SetPixel(pixelIndex,pixelValue);
aux = (*salida)->GetPixel(pixelIndex); // checking that the image has been correctly transtaled from im_proc to salida-- > CHECKED
}
}
}
そして、ここで呼び出されます:
//Translation of the double* image into itk:smartpointer image
double2itk(out_inv, &(ui.imageframe->imagereader), alto, ancho);
その後、ユーザー インターフェイスが更新されます。
// Update of the image shonw in the user interface
ui.imageframe->update();
問題は、すべてが正しく機能しているように見えますが、インターフェイスの画像が更新されていないことです。私のプロジェクトにも有効な別のオプションは、画像を「.bmp」または「.jpeg」ファイルに保存することです。誰かが私を助けることができますか?何が正しく機能していないかについてのアイデアはありますか? この画像ファイルを作成する機能はありますか?