int main(int argc, char *argv[])
{
if( argc < 2 )
{
return 1;
}
const char *filename = argv[1];
const char filename_invalid[] = "this is a file that may not exist on this disk.dcm";
};
filenames.push_back( filename );
filenames.push_back( filename_invalid );
if( !s.
Scan( filenames ) )
{
return 1;
}
if( s.
IsKey( filename ) )
{
std::cout << "INFO:" << filename << " is a proper Key for the Scanner (this is a DICOM file)" << std::endl;
}
if( !s.
IsKey( filename_invalid ) )
{
std::cout << "INFO:" << filename_invalid << " is not a proper Key for the Scanner (this is either not a DICOM file or file does not exist)" << std::endl;
}
for( ; ptag != tag_array + 3; ++ptag )
{
gdcm::Scanner::TagToValue::const_iterator it = ttv.find( *ptag );
if( it != ttv.end() )
{
std::cout << *ptag << " was properly found in this file" << std::endl;
const char *value = it->second;
if( *value )
{
std::cout << " It has the value: " << value << std::endl;
}
else
{
std::cout << " It has no value (empty)" << std::endl;
}
}
else
{
std::cout << "Sorry " << *ptag << " could not be found in this file" << std::endl;
}
}
return 0;
}