Skip to content

Commit

Permalink
BUG: openigtlink#54 Color not supported in vtkImageData->igtl::ImageM…
Browse files Browse the repository at this point in the history
…essage.

Fixed by adding NumComponents
  • Loading branch information
Christian Askeland committed Oct 6, 2015
1 parent 435b1c3 commit 978547d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MRML/vtkIGTLToMRMLImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,12 @@ int vtkIGTLToMRMLImage::MRMLToIGTL(unsigned long event, vtkMRMLNode* mrmlNode, i
int scalarType; // scalar type
//double *origin;
double *spacing; // spacing (mm/pixel)
//int ncomp;
int ncomp;
int svoffset[] = {0, 0, 0}; // sub-volume offset
int endian;

scalarType = imageData->GetScalarType();
//ncomp = imageData->GetNumberOfScalarComponents();
ncomp = imageData->GetNumberOfScalarComponents();
imageData->GetDimensions(isize);
//imageData->GetExtent(0, isize[0]-1, 0, isize[1]-1, 0, isize[2]-1);
//origin = imageData->GetOrigin();
Expand All @@ -608,6 +608,7 @@ int vtkIGTLToMRMLImage::MRMLToIGTL(unsigned long event, vtkMRMLNode* mrmlNode, i
this->OutImageMessage->SetEndian(endian);
this->OutImageMessage->SetDeviceName(volumeNode->GetName());
this->OutImageMessage->SetSubVolume(isize, svoffset);
this->OutImageMessage->SetNumComponents(ncomp);
this->OutImageMessage->AllocateScalars();

memcpy(this->OutImageMessage->GetScalarPointer(),
Expand Down

0 comments on commit 978547d

Please sign in to comment.