#include <map>
#include <math.h>
int main(int argc, char *argv [])
{
if( argc < 2 ) return 1;
const char *filename = argv[1];
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
{
}
{
return 1;
}
if( !bv )
{
return 1;
}
std::istringstream is(str);
std::string s;
typedef std::map< std::string, std::string > MyMapType;
MyMapType mymap;
while( std::getline(is, s ) )
{
std::string::size_type pos = s.find( '=' );
if( pos != std::string::npos )
{
std::string sub1 = s.substr(0, pos);
sub1.erase( sub1.find_last_not_of(' ') + 1);
std::string sub2 = s.substr(pos+1);
sub2.erase( 0, sub2.find_first_not_of(' '));
mymap.insert( MyMapType::value_type(sub1, sub2) );
}
else
{
}
}
const char fourierstr[] = "sKSpace.ucSlicePartialFourier";
std::cout << fourier << std::endl;
MyMapType::const_iterator it = mymap.find ( fourierstr );
if( it == mymap.end() ) return 1;
const std::string &partial_fourier = it->second;
if( partial_fourier == "0x1" )
{
std::cout << "partial fourier is 4/8" << std::endl;
}
else if( partial_fourier == "0x2" )
{
std::cout << "partial fourier is 5/8" << std::endl;
}
else if( partial_fourier == "0x4" )
{
std::cout << "partial fourier is 6/8" << std::endl;
}
else if( partial_fourier == "0x8" )
{
std::cout << "partial fourier is 7/8" << std::endl;
}
else if( partial_fourier == "0x10" )
{
std::cout << "partial fourier is 8/8" << std::endl;
}
else
{
std::cerr << "Impossible: " << partial_fourier << std::endl;
return 1;
}
#if 0
const char gspec[] = "sGRADSPEC.flSensitivityX";
it = mymap.find( gspec );
if( it == mymap.end() ) return 1;
const std::string &dummy = it->second;
std::cout << dummy << std::endl;
std::cout << csaentry << std::endl;
#endif
const char sliceorderstr[] = "sSliceArray.ucMode";
std::cout << sliceorder << std::endl;
it = mymap.find ( sliceorderstr );
if( it == mymap.end() ) return 1;
const std::string &slice_order = it->second;
if( slice_order == "0x1" )
{
std::cout << "slice_order: ASCENDING" << std::endl;
}
else if( slice_order == "0x2" )
{
std::cout << "slice_order: DESCENDING" << std::endl;
}
else if( slice_order == "0x4" )
{
std::cout << "slice_order: INTERLEAVED" << std::endl;
}
else
{
std::cerr << "Impossible: " << slice_order << std::endl;
return 1;
}
{
std::cout << mrprot << std::endl;
}
return 0;
}
Class to represent binary value (array of bytes)
Definition gdcmByteValue.h:35
const char * GetPointer() const
Definition gdcmByteValue.h:110
VL GetLength() const override
Definition gdcmByteValue.h:77
Class to represent a CSA Element.
Definition gdcmCSAElement.h:30
const ByteValue * GetByteValue() const
Definition gdcmCSAElement.h:78
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
const DataElement & GetDataElement(const Tag &t) const
Definition gdcmDataSet.h:188
bool FindDataElement(const PrivateTag &t) const
Look up if private tag 't' is present in the dataset:
const CSAHeaderDict & GetCSAHeaderDict() const
const DataSet & GetDataSet() const
Get Data Set.
Definition gdcmFile.h:57
Dicts const & GetDicts() const
static Global & GetInstance()
return the singleton instance
ImageReader.
Definition gdcmImageReader.h:34
Class for MrProtocol.
Definition gdcmMrProtocol.h:37
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner)
Definition gdcmPrivateTag.h:39
const File & GetFile() const
Set/Get File.
Definition gdcmReader.h:72
void SetFileName(const char *filename_native)