Re: [Gdcm-hackers] Problem with CStore while trying to store Explicit files in the PACS server.
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Petchirajan J <pet...@in...> - 2011-02-25 08:54:39
|
Dear Mark,Thanks for your response.I am searching for the interface CompositeNetworkFunctions in GDCM. I can't find this interface in the gdcm. could you please tell me where the CompositeNetworkFunctions interface is present?And I am trying to convert the implicit image to explicit image usinggdcmFileExplicitFilter class. The code i used is given below.gdcm::Writer w;w.SetFileName("D:\\ExplicitImg.dcm");gdcm::File &f = w.GetFile();f.SetDataSet(implicitDataSet);gdcm::FileMetaInformation &fmi = f.GetHeader();const char *tsuid = gdcm::TransferSyntax::GetTSString( gdcm::TransferSyntax::ExplicitVRLittleEndian );gdcm::DataElement tsDE( gdcm::Tag(0x0002,0x0010) );tsDE.SetByteValue( tsuid, strlen(tsuid) );tsDE.SetVR( gdcm::Attribute::GetVR() );fmi.Clear();fmi.Replace( tsDE );fmi.SetDataSetTransferSyntax(gdcm::TransferSyntax::ExplicitVRLittleEndian);w.SetCheckFileMetaInformation( true );gdcm::FileExplicitFilter fef;fef.SetChangePrivateTags(true);fef.SetFile(f);if( !fef.Change() ){thr
ow gcnew Exception("Failed to convert to Explict Image"); }if (!w.Write()){throw gcnew Exception("Failed to write");}In the input implicit image i have some private sequence tags. I need to convert that private tags also to the explicit image. But, the VR for that tags are set "UN". For this problem i set Change Private Tag property true for gdcm::FileExplicitFilter. After that also i received the tag as Unknown format. Can you please help me to convert the implicit image with private tags to explicit image. Thanks & Regards, Petchirajan.J Original message From:"Mark Roden"< mm...@gm... >Date: 24 Feb 11 23:34:11Subject: Re: [Gdcmhackers] Problem with CStore while trying to store Explicit files in the PACS server.To: Cc: gdcmhackers Hi Petchirajan,We're looking into this issue right now.In the meantime, maybe trying the CompositeNetworkFunctions interfacewill help.There are now two Move operations in that interface, onethat reports the result to disk and one that report
s the result tomemory.This interface should allow you to avoid having to manipulateredundant tags (such as 0x8, 0x52).Your code would become something like:std::vector theFilenames;theFileNames.pushback("D:\\MRMONO216headSent.dcm");bool didItWork = CompositeNetworkFunctions::CStore("192.168.1.34",11112, theFileNames, "ANY", "DCM4CHEE");for the first part, and for the second part:theKeys.pushback(std::makepair(gdcm::Tag(0x8, 0x18),"1.2.840.113619.2.1.3352.1015047400.4.3.834485381"));BaseRootQuery* theQuery =CompositeNetworkFunctions::ConstructQuery(gdcm::ePatientRootType,gdcm::EQueryLevel::eImageOrFrame, theKey, true);std::vector theDataSets =CompositeNetworkFunctions::CMoveToMemory("192.168.1.34", 11112,theQuery, 11111, "ANY", "DCM4CHEE");delete theQuery;And then you can compare the results of the retrieved data set(s) withthe ones you sent over.We added this interface over the one you're using to make the processof using gdcm networking functions easier.I hope this helps wh
ile we look into your specific issue,MarkOn Sun, Feb 20, 2011 at 9:10 PM, Petchirajan Jwrote:>> Dear All,>> I stored the Explicit DICOM file in the DCM4CHEE server using CStore> functionality. While trying to move that same file from the server to my> local machine, the file is received as a Implicit file. while trying to read> that file the tags in the gdcm::DataSet has the invalid VR. I received the> problem while following the below procedure.>> 1. First i store the "MRMONO216headSent.dcm" file to the DCM4CHEE server> using CStore Functionality.>> gdcm::network::ULConnectionManager theManager;> gdcm::Reader reader;> reader.SetFileName("D:\\MRMONO216headSent.dcm");> if(!reader.Read())> throw gcnew Exception("Can't Read File " + fileNames[0]);> const gdcm::DataSet &ds = reader.GetFile().GetDataSet();> if (!theManager.EstablishConnection("ANY", "DCM4CHEE", "192.168.1.34", 0,> 11112, 1000, gdcm::network::eStore, ds))> {> throw gcnew Exception("Failed to establish connection."
);> }> theManager.SendStore( (gdcm::DataSet*)& amp;ds );> theManager.BreakConnection(1);>> 2. After that i moved the same file named "MRMONO216headReceived.dcm" in> my local system using the CMove Functionality.>> std::vector theDataSets;> gdcm::network::ULConnectionManager *theManager = GetConnectionManager();> gdcm::network::BaseRootQuery* theQuery => gdcm::network::QueryFactory::ProduceQuery(gdcm::network::ePatientRootType,> gdcm::network::EQueryLevel::eImageOrFrame);> theQuery>SetSearchParameter(gdcm::Tag(0x8, 0x52), "IMAGE");> //Query/Retrieval Level> theQuery>SetSearchParameter(gdcm::Tag(0x8, 0x18),> "1.2.840.113619.2.1.3352.1015047400.4.3.834485381"); //SOP Instance UID> if (!theManager.EstablishConnectionMove("ANY", "DCM4CHEE", "192.168.1.34",> 0, 11112, 1000, 11112, theQuery>GetQueryDataSet()))> {> throw gcnew Exception("Failed to establish connection.");> }> std::vector theDataSets = theManager.SendMove( theQuery );> gdcm:: Writer w;> w.SetFileName("D:\\MRMONO216he
adSent.dcm");> gdcm::File &f = w.GetFile();> f.SetDataSet(*itor);> gdcm::FileMetaInformation &fmi = f.GetHeader();> fmi.SetDataSetTransferSyntax( gdcm::TransferSyntax::ImplicitVRLittleEndian> );> w.SetCheckFileMetaInformation( true );> if (!w.Write())> {> throw gcnew Exception("Failed to write");> }>> The DICOM file which i sent to the DCM4CHEE> server(MRMONO216headSent.dcm) is having the Explicit Transfer Syntax.> But the received DICOM file from the Server is having the Implicit Transfter> Syntax. Due to this problem the Value Representation of the all tags are> unknown in the received file. For your reference i attached the file which i> sent to the server and the received file and the DataSet of those two files.>> In the gdcmULConnectionManager class, while establishing the connection for> CMove they mention "we do not support explicit Transfer Syntax" in the line> 105.>> 100: gdcm::netw ork::TransferSyntaxSub ts;> 101: ts.SetNameFromUID(> gdcm::UIDs::ImplicitVRLittleEnd
ianDefaultTransferSyntaxforDICOM );> 102: pc.AddTransferSyntax( ts );> 103: ts.SetNameFromUID( gdcm::UIDs::ExplicitVRLittleEndian );> 104: //ts.SetNameFromUID(> gdcm::UIDs::JPEGLosslessNonHierarchicalFirstOrderPredictionProcess14SelectionValue1DefaultTransferSyntaxforLosslessJPEGImageCompression);> 105: //pc.AddTransferSyntax( ts ); // we do not support explicit (mm)> 106: switch (inConnectionType){>> Is this associated with the problem i mentioned?> > Regards,> Petchirajan.J>> Dear gdcmhackers ! Get Yourself a cool, short @in.com Email ID now!> > The ultimate allinone performance toolkit: Intel(R) Parallel Studio XE:> Pinpoint memory and threading errors before they happen.> Find and fix more than 250 security defects in the development cycle.> Locate bottlenecks in serial and parallel code that limit performance.> http://p.sf.net/sfu/inteldev2devfeb> > Gdcmhackers mailing list> Gdc...@li...> https://lists.sourceforge.net/lists/listinfo/gdcmhackers>>Get
Yourself a cool, short @in.com Email ID now!
|