Skip to content

Commit

Permalink
Merge topic 'nifti-unused-endian'
Browse files Browse the repository at this point in the history
61b4e43 Removed unused local variable from nifti writer.

Acked-by: Kitware Robot <[email protected]>
Reviewed-by: Sean McBride <[email protected]>
Merge-request: !2336
  • Loading branch information
dgobbi authored and kwrobot committed Jan 9, 2017
2 parents 1fab2a9 + 61b4e43 commit a1e7fab
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions IO/Image/vtkNIFTIImageWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "vtkInformationVector.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkErrorCode.h"
#include "vtkByteSwap.h"
#include "vtkMatrix4x4.h"
#include "vtkMath.h"
#include "vtkCommand.h"
Expand Down Expand Up @@ -777,7 +776,6 @@ int vtkNIFTIImageWriter::RequestData(
(this->OwnHeader->GetDataType() == NIFTI_TYPE_RGB24 ||
this->OwnHeader->GetDataType() == NIFTI_TYPE_RGBA32));

int swapBytes = 0;
int scalarSize = data->GetScalarSize();
int numComponents = data->GetNumberOfScalarComponents();
int outSizeX = static_cast<int>(this->OwnHeader->GetDim(1));
Expand All @@ -799,7 +797,7 @@ int vtkNIFTIImageWriter::RequestData(

// add a buffer for planar-vector to packed-vector conversion
unsigned char *rowBuffer = 0;
if (vectorDim > 1 || planarRGB || swapBytes)
if (vectorDim > 1 || planarRGB)
{
rowBuffer = new unsigned char[outSizeX*fileVoxelIncr];
}
Expand Down Expand Up @@ -846,7 +844,7 @@ int vtkNIFTIImageWriter::RequestData(

while (!this->AbortExecute && !this->ErrorCode)
{
if (vectorDim == 1 && !planarRGB && !swapBytes)
if (vectorDim == 1 && !planarRGB)
{
// write directly from input, instead of using a buffer
rowBuffer = ptr;
Expand All @@ -867,11 +865,6 @@ int vtkNIFTIImageWriter::RequestData(
}
}

if (swapBytes != 0 && scalarSize > 1)
{
vtkByteSwap::SwapVoidRange(rowBuffer, rowSize, scalarSize);
}

if (isCompressed)
{
int code = gzwrite(file, rowBuffer, rowSize*scalarSize);
Expand Down Expand Up @@ -932,7 +925,7 @@ int vtkNIFTIImageWriter::RequestData(

// only delete this if it was alloced (if it was not alloced, it
// would have been set directly to a row out the output image)
if (vectorDim > 1 || swapBytes || planarRGB)
if (vectorDim > 1 || planarRGB)
{
delete [] rowBuffer;
}
Expand Down

0 comments on commit a1e7fab

Please sign in to comment.