MCPcopy Create free account
hub / github.com/Kitware/VTK / CanReadFile

Method CanReadFile

IO/Image/vtkSLCReader.cxx:460–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460int vtkSLCReader::CanReadFile(const char* fname)
461{
462 FILE* fp;
463 int magic_num = 0;
464 if ((fp = vtksys::SystemTools::Fopen(fname, "rb")) == nullptr)
465 {
466 return 0;
467 }
468
469 auto resultMagicNum = vtk::scan_value<int>(fp);
470 if (!resultMagicNum)
471 {
472 fclose(fp);
473 return 0;
474 }
475 magic_num = resultMagicNum->value();
476 if (magic_num != 11111)
477 {
478 fclose(fp);
479 return 0;
480 }
481 fclose(fp);
482 return 3;
483}
484
485void vtkSLCReader::PrintSelf(ostream& os, vtkIndent indent)
486{

Callers 15

CreateImageReader2Method · 0.45
TestBMPReaderFunction · 0.45
TestDICOMImageReaderFunction · 0.45
TestWriteToUnicodeFileFunction · 0.45
TestHDRReaderFunction · 0.45
TestNrrdReaderFunction · 0.45
TestDisplayFunction · 0.45
TestDisplayFunction · 0.45
TestJPEGReaderFunction · 0.45
TestNIFTIReaderWriterFunction · 0.45

Calls 1

valueMethod · 0.45

Tested by 15

TestBMPReaderFunction · 0.36
TestDICOMImageReaderFunction · 0.36
TestWriteToUnicodeFileFunction · 0.36
TestHDRReaderFunction · 0.36
TestNrrdReaderFunction · 0.36
TestDisplayFunction · 0.36
TestDisplayFunction · 0.36
TestJPEGReaderFunction · 0.36
TestNIFTIReaderWriterFunction · 0.36
TestTGAReaderFunction · 0.36