Message: Re: extended DICOM compilation problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: extended DICOM compilation problem 

Keywords: dicom index rindex
Forum: Medical Applications
Re: None extended DICOM compilation problem (Carlo Nicolini)
Date: 14 Jan, 2008
From: Pedro Arce Dubois <pedro.arce@ciemat.es>

index and rindex are used for string manipulation. In the case there to extract the two numbers from a string that looks like "0.9765625\\0.9765625 " You may try substituting the text in DicomHandler.cc

        char * buff = new char[LINEBUFFSIZE];
	char * sepPos = index(data, '\\');
	char * termPos = rindex(data, '\0');
	std::strncpy(buff, data, sepPos - data);
	pixelSpacingX = atof(buff);
	std::strncpy(buff, sepPos+1, termPos - sepPos - 1);
	pixelSpacingY = atof(buff);
	std::printf("[0x00280030] Pixel Spacing (mm) -> %s\n", data);
	delete [] buff;

by

      G4String datas(data);
      int iss = datas.find('\\');
      pixelSpacingX = atof( datas.substr(0,iss).c_str() );
      pixelSpacingY = atof( datas.substr(iss+2,datas.length()).c_str() );

Pedro

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: extended DICOM compilation problem"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]