[Insight-users] how to create a header for a non Dicom Image,
set some field in it, and save it as Dicom file
charfeddine amir
charfeddine_amir at yahoo.fr
Tue Feb 21 09:17:23 EST 2006
Hi All,
I ve read section 7 .1 2 .7 Changing a DICOM Header in the ItkSoftwareGuide, but here we change the header of a Dicom Image. In my case, i have to create a new image and then to set some header field, how could i do that?
I try this but it seems not working :
DictionaryType & dictionary = m_DiasstoledImage->GetMetaDataDictionary();
// m_DiasstoledImage is the new image
std::string entryId( Dist );
std::string value;
value=ltostr(R+RP);
itk::EncapsulateMetaData<std::string>( dictionary, entryId, value );
entryId = DistP;
value=ltostr(R);
itk::EncapsulateMetaData<std::string>( dictionary, entryId, value );
entryId = PAngle;
value=ltostr(PAngleValue);
itk::EncapsulateMetaData<std::string>( dictionary, entryId, value );
entryId = SAngle;
value=ltostr(SAngleValue);
itk::EncapsulateMetaData<std::string>( dictionary, entryId, value );
compt++;
value=ltostr(compt);
strcpy(m_ProjectionFileName,"projection");
strcat(m_ProjectionFileName,value.c_str());
strcat(m_ProjectionFileName,".dcm");
std::cout<<m_ProjectionFileName<<std::endl;
m_2DRescaler->SetInput(m_DiasstoledImage);
m_ImageWriter->SetFileName(m_ProjectionFileName);
m_ImageWriter->SetInput( m_2DRescaler->GetOutput() );
m_ImageWriter->SetImageIO( dicomIO );
m_ImageWriter->Update();
thx a lot,
---------------------------------
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.Téléchargez la version beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060221/a1a644d8/attachment.html
More information about the Insight-users
mailing list