Display node full fill view

we create a new extension to load dicom image, code as below:

// add to volume node
 double dirs[3][3];
 for (int i = 0; i < 3; i++)
 for (int j = 0; j < 3; j++)
 dirs[i][j] = 0.0;
 dirs[0][0] = 1;
 dirs[1][1] = 1;
 dirs[2][2] = 1;
auto volumeNode = vtkMRMLScalarVolumeNode::SafeDownCast(
    this->logic()->GetMRMLScene()->AddNewNodeByClass("vtkMRMLScalarVolumeNode", "Source"));
volumeNode->SetAndObserveImageData(vtkImageDataPointer);
//volumeNode->SetOrigin(100,100,100);
//volumeNode->SetSpacing(1,1,1);
//volumeNode->SetIJKToRASDirections(dirs );
volumeNode->CreateDefaultDisplayNodes();
volumeNode->SetDisplayVisibility(true);

the problem is that

  1. the image isn’t displayed without click “visible” button
  2. it show nothing if drag slider to change slicer in “blue” rect range
  3. image displayed on the right-down of view

i think it maybe the origin , spacing and direction error, but i dont know how get from itk image

The only supported method of loading DICOM images into Slicer is by using the DICOM module. There are many different ways to deal with DICOM data, but if you do it your own way then we cannot help.