Skip to content
Snippets Groups Projects
Commit 9084b08f authored by Dhanannjay Deo's avatar Dhanannjay Deo
Browse files

FIX: for openslide v3.4.0-1 in ubuntu

parent 455ce318
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,9 @@ mark_as_advanced(OPENSLIDE_INCLUDE_DIR OPENSLIDE_LIBRARY)
set(OPENSLIDE_SRCS vtkOpenSlideReader.cxx)
include_directories(${OPENSLIDE_INCLUDE_DIRS})
set_source_files_properties(vtkOPENSLIDE WRAP_EXCLUDE)
set(${vtk-module}_SYSTEM_INCLUDE_DIRS
${OPENSLIDE_INCLUDE_DIRS})
vtk_module_library(vtkDomainsMicroscopy ${OPENSLIDE_SRCS})
......
......@@ -7,8 +7,8 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
)
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestOpenSlideReaderPartial.cxx
"DATA{${VTK_TEST_INPUT_DIR}/Microscopy/small2.ndpi}"
TestOpenSlideReaderPartialTIF,TestOpenSlideReaderPartial.cxx
"DATA{${VTK_TEST_INPUT_DIR}/Microscopy/pathology.tif}"
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
......@@ -30,6 +30,9 @@
// Main program
int TestOpenSlideReader(int argc, char** argv)
{
// This test is known to fail with openslide library libopenslide-dev shipped
// with ubuntu 14.04 as of March 31'2016. It does pass on fedora23, or if the
// openslide library is built from source
const char* rasterFileName = vtkTestUtilities::ExpandDataFileName(argc, argv,
"Data/Microscopy/small2.ndpi");
......
......@@ -30,19 +30,20 @@
// Main program
int TestOpenSlideReaderPartial(int argc, char** argv)
{
const char* rasterFileName = vtkTestUtilities::ExpandDataFileName(argc, argv,
"Data/Microscopy/small2.ndpi");
if ( argc <= 1 )
{
std::cout << "Usage: " << argv[0] << " <image file>" << endl;
return EXIT_FAILURE;
}
//std::cout << "Got Filename: " << rasterFileName << std::endl;
std::cout << "Got Filename: " << argv[1] << std::endl;
// Create reader to read shape file.
vtkNew<vtkOpenSlideReader> reader;
reader->SetFileName(rasterFileName);
reader->SetFileName(argv[1]);
reader->UpdateInformation();
// reader->Print(cout);
delete [] rasterFileName;
int extent[6] = {200,499,200,499,0,0};
int extent[6] = {100,299,100,299,0,0};
reader->UpdateExtent(extent);
......
2513faaa18fd17a568b47e0bf0c10531
......@@ -67,18 +67,17 @@ void vtkOpenSlideReader::ExecuteDataWithInformation(vtkDataObject *output,
outInfo,
inExtent);
// cout << "OpenSlideReaderDataInf: " << inExtent[0] << ", " << inExtent[1] << ", " << inExtent[2] << ", " << inExtent[3] << endl;
vtkImageData *data = this->AllocateOutputData(output, outInfo);
//data->GetExtent(this->OutputExtent);
//data->GetIncrements(this->OutputIncrements);
if(this->openslide_handle == NULL)
{
std::cout << "In the data info update, file is not updated" << std::endl;
vtkErrorWithObjectMacro(this,
"File could not be read by openslide"
);
return;
}
//std::cout << "Extents: " << data->GetExtent() << std::endl;
//std::cout << "OpenSlideReader Extents: " << data->GetExtent() << std::endl;
this->ComputeDataIncrements();
......
6a89389966723771bc54d12bbcba1a0b
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment