Skip to content

Commit ec9aedc

Browse files
committed
Fixed small bug not displaying labelled images properly.
1 parent dcd3d2f commit ec9aedc

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Qt/milxQtFile.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ bool milxQtFile::openImage(const QString filename, vtkImageData* data)
9292
charFormat = true;
9393
itk::ObjectFactoryBase::RegisterFactory( itk::RawImageIOFactory<unsigned char, 3>::New() );
9494
}
95-
if(typeStr == "unsigned" || typeStr == "unsigned_short" || typeStr == "short" || typeStr == "unsigned short" || typeStr == "unsigned_int" || typeStr == "unsigned int" || typeStr == "int") //16-bit or 32-bit integers
95+
else if(typeStr == "unsigned" || typeStr == "unsigned_short" || typeStr == "short" || typeStr == "unsigned short" || typeStr == "unsigned_int" || typeStr == "unsigned int" || typeStr == "int") //16-bit or 32-bit integers
9696
integerFormat = true;
9797
else if(extension == "vti")
9898
{
@@ -298,16 +298,16 @@ bool milxQtFile::openImage(const QString filename, milxQtImage* data)
298298

299299
if(!vtkFormat && !pnmImage)
300300
{
301-
cout << "Trying to read image header ..." << endl;
302-
//Check type of medical image
303-
std::string pixelType, componentType;
304-
if(!milx::File::ReadImageInformation(filename.toStdString(), pixelType, componentType, dataDimensions))
305-
{
306-
cerr << "Failed reading header of image. File may not be an image. Exiting" << endl;
307-
return false;
308-
}
309-
dataPixelType = pixelType.c_str();
310-
dataComponentType = componentType.c_str();
301+
cout << "Trying to read image header ..." << endl;
302+
//Check type of medical image
303+
std::string pixelType, componentType;
304+
if(!milx::File::ReadImageInformation(filename.toStdString(), pixelType, componentType, dataDimensions))
305+
{
306+
cerr << "Failed reading header of image. File may not be an image. Exiting" << endl;
307+
return false;
308+
}
309+
dataPixelType = pixelType.c_str();
310+
dataComponentType = componentType.c_str();
311311

312312
if((componentType == "unsigned_char" && pixelType == "scalar") || (componentType == "unsigned char" && pixelType == "scalar"))
313313
{
@@ -338,7 +338,7 @@ bool milxQtFile::openImage(const QString filename, milxQtImage* data)
338338

339339
data->SetInput(charImg, true);
340340
}
341-
if(integerFormat)
341+
else if(integerFormat)
342342
{
343343
intImageType::Pointer intImg;
344344

src/Qt/milxQtMain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ bool milxQtMain::loadFile(const QString &filename)
569569
QPointer<milxQtRenderWindow> renWin = loadedPlugin->genericResult();
570570
if(renWin)
571571
{
572-
printInfo("Loading Generic Result");
572+
printInfo("Loading Plugin Generic Result");
573573
if(renWin->getName() == "")
574574
renWin->setName(filename);
575575
renWin->setConsole(console);
@@ -581,7 +581,7 @@ bool milxQtMain::loadFile(const QString &filename)
581581
QPointer<milxQtModel> model = loadedPlugin->modelResult();
582582
if(model)
583583
{
584-
printInfo("Loading Model Result");
584+
printInfo("Loading Plugin Model Result");
585585
if(model->getName() == "")
586586
model->setName(filename);
587587
model->setConsole(console);
@@ -593,7 +593,7 @@ bool milxQtMain::loadFile(const QString &filename)
593593
QPointer<milxQtImage> image = loadedPlugin->imageResult();
594594
if(image)
595595
{
596-
printInfo("Loading Image Result");
596+
printInfo("Loading Plugin Image Result");
597597
if(image->getName() == "")
598598
image->setName(filename);
599599
image->setConsole(console);

0 commit comments

Comments
 (0)