新しいアイデアがないことが数日あるので、私はあなたに伝えたいのですが問題があります。Qtのユーザーインターフェイスでitkイメージを更新する
私は、画像をダブル*ポインタと指摘している、と私はこの方法で作られた、この目的のために、ユーザーのグラフィックインターフェースを更新するためsmartpointer :: ITKにそれを翻訳したい:
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'ファイルに保存することです。 誰かが私を助けることができますか?何が正しく動作していないのアイデア?この画像ファイルを作成する機能はありますか?
はあなたが画像を見ることができます:
非常に素晴らしいウィキ例でもありますか? – blueskin
私はプロジェクトの冒頭にロードされた同じイメージを見ていますが、今は "新しい"イメージです。私はitkイメージへの翻訳が正しいと言います。 "aux =(* salida) - > GetPixel(pixelIndex); "適切な結果を与える – Antonio