ImageInfoUR* imageInfo = this->m_ImagesDeque->Undo();
if (imageInfo != NULL)
{
- this->SetRedoImage(imageInfo->GetRegion());
+ //this->SetRedoImage(imageInfo->GetRegion());
this->DrawUR(imageInfo);
}
}
//virtual
void ImageUndoRedo::DrawUR(ImageInfoUR* imageInfo) {
VTKImageDataPointerType img = imageInfo->GetImage();
- for (int i = imageInfo->GetRegion().minX, x = 0;
- i <= imageInfo->GetRegion().maxX; i++, x++) {
- for (int j = imageInfo->GetRegion().minY, y = 0;
- j <= imageInfo->GetRegion().maxY; j++, y++) {
- for (int k = imageInfo->GetRegion().minZ, z = 0;
- k <= imageInfo->GetRegion().maxZ; k++, z++) {
- float value = img->GetScalarComponentAsFloat(i, j, k, 0);
- this->m_CurrentImage->SetScalarComponentFromFloat(i, j, k, 0,
- value);
+ if( img != NULL )
+ {
+ for (int i = imageInfo->GetRegion().minX, x = 0;
+ i <= imageInfo->GetRegion().maxX; i++, x++) {
+ for (int j = imageInfo->GetRegion().minY, y = 0;
+ j <= imageInfo->GetRegion().maxY; j++, y++) {
+ for (int k = imageInfo->GetRegion().minZ, z = 0;
+ k <= imageInfo->GetRegion().maxZ; k++, z++) {
+ float value = img->GetScalarComponentAsFloat(i, j, k, 0);
+ this->m_CurrentImage->SetScalarComponentFromFloat(i, j, k, 0,
+ value);
+ } //rof
} //rof
} //rof
- } //rof
- this->m_CurrentImage->Modified();
+ this->m_CurrentImage->Modified();
+ }
}