DVTk (Main) Forum Index
   All Posts (noldor)

 Bottom   Previous Topic   Next Topic

(1) 2 3 »


Removing my email from forum
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
Hi.
I see there is no post editing option on Dvtk forums.
I had written my email address to public at the following topic long time ago.. Can you guys please remove or edit that post.

http://www.dvtk.org/modules/newbb/vie ... ost_id=1321#forumpost1321

Thank you.


P.S.
I've noticed that forum is being attacked by spammers lately.

Posted on: 2011/6/10 17:03
Transfer the post to other applications Transfer
Topic | Forum


Re: C-GET DICOM file with SCU from SCP using DVTk
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
EDIT:
the line :
string numberOfRemaining = "" + recievedMsg.DataSet["0x00100010"].Values[0];

must be:
string numberOfRemaining = "" + recievedMsg.CommandSet["0x00001020"].Values[0];

Posted on: 2011/1/24 15:10
Transfer the post to other applications Transfer
Topic | Forum


Re: C-GET DICOM file with SCU from SCP using DVTk
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline

I'm not very familiar how exactly C-GET implementation works out.I never had experience with it.

But so far what i know is; SCU sends c-get request.. Scp first responds with a storage-request in the same association... After each storage message, scp also sends c-get responses. If this implementation is true; your dvtk library codes should look like the following :

 

                public class myCgetSCU : DicomThread

                {

                    ThreadManager threadManager;

                    MainThread mainThread;

                    public myCgetSCU()

                    {

                      

                       

                    }

 

                  

 

                    protected override void Execute()

                    {

                        // first load operations for dicom thread

                        // making these operations sometimes returns error if they are in the constructer.

                        // making them in execute method is safer...

 

                        threadManager = new ThreadManager();

                        mainThread = new MainThread();

 

                        mainThread.Initialize(threadManager);

                        this.Initialize(mainThread);

                        this.Options.LoadDefinitionFile("........ dvtk def file 1 for query retrieve ");

                        this.Options.LoadDefinitionFile("........ dvtk def file 2 for query retrieve ");

                        // .....

                        // .....

                        this.Options.LoadDefinitionFile("........ dvtk def file 1 for storage ");

                        this.Options.LoadDefinitionFile("........ dvtk def file 2 for storage ");

                        // .....

                        // .....

 

                        this.Options.AutoValidate = false;

                        this.Options.StorageMode = Dvtk.Sessions.StorageMode.AsMedia;

 

                        this.Options.RemoteAeTitle = "RemoteSCPAe";

                        this.Options.RemoteHostName = "RemoteIpAdress";

                        this.Options.RemotePort = 104;

 

                        this.MessageReceivedEvent += new MessageReceivedEventHandler(mySCU_MessageReceivedEvent);

 

                        // ------------------------------

 

                        // preapare your presentation contexts for association request...

 

                        string abstractSyntax = ".... sop class uid for query retrieve ";

                        string[] transferSyntaxes = new string[] { " tr.syntaxUid 1 your scu support", " tr.syntaxUid 2 your scu support", " .... " };

                        PresentationContext queryRetrieveContext = new PresentationContext( abstractSyntax, transferSyntaxes  );

 

                        // because you are using c-get instead of a C-move, you should

                        // create more presentaion contexes due to your supported storage sop classes

                        string abstractSyntaxStor1 = ".... sop class uid for query retrieve ";

                        string[] transferSyntaxesStor1 = new string[] { " tr.syntaxUid 1 your scu support", " tr.syntaxUid 2 your scu support", " .... " };

                        PresentationContext queryRetrieveContextStor1 = new PresentationContext(abstractSyntaxStor1, transferSyntaxesStor1);

                        // other storage presentation contexes..

                        // ..

                        // ..

                        // ..

 

 

                        // send your association request to scp

                        SendAssociateRq(new PresentationContext[] { queryRetrieveContext , queryRetrieveContextStor1 });

 

                        // wait for association response

                        ReceiveMessage();

                    }

 

                    void mySCU_MessageReceivedEvent(DvtkHighLevelInterface.Dicom.Messages.DicomProtocolMessage dicomProtocolMessage)

                    {

                        if (dicomProtocolMessage.IsAssociateAc)

                        {

                            // Thread will come here right after your association is accepted by remote scp

 

                            DicomMessage cGetRqMsg = new DvtkHighLevelInterface.Dicom.Messages.DicomMessage(DvtkData.Dimse.DimseCommand.CGETRQ);

                            cGetRqMsg.CommandSet.Set(DvtkData.Dimse.Tag.AFFECTED_SOP_CLASS_UID, DvtkData.Dimse.VR.UI, ".. query retrieve sop class uid");

                            cGetRqMsg.CommandSet.Set(DvtkData.Dimse.Tag.MESSAGE_ID, DvtkData.Dimse.VR.US, "1");

                            // ..... set other commandSet values due to dicom implementation

                            // .....

                            cGetRqMsg.DataSet.Set(DvtkData.Dimse.Tag.STUDY_INSTANCE_UID, DvtkData.Dimse.VR.UI, " .. study instance uid you request .. ");

                            // ..... set other dataSet values due to dicom implementation

                            // .....

                            Send(cGetRqMsg);

 

                            cGetRqMsg.DataSet.Clear();

                            cGetRqMsg = null;

 

                            ReceiveMessage();

                        }

                        else if (dicomProtocolMessage.IsDicomMessage)

                        {

                            if (dicomProtocolMessage.DicomMessage.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.CGETRSP)

                            {

                                // Thread will come here after your previous c-get request is being responded by remote scp and after you recieved a store request

                                DicomMessage recievedMsg = dicomProtocolMessage.DicomMessage;

 

                                // you can get attribute values from recieved message like this...

 

                                string status = "" + recievedMsg.CommandSet["0x00000900"].Values[0];

                                if (status != "65280")

                                {

                                    // status = pending

                                    // storage operations will continue by the remote scp

                                    string numberOfRemaining = "" + recievedMsg.DataSet["0x00100010"].Values[0];

                                    // ... you can get other status informations like this one

                                    // ..

                                    // ..

 

                                    // you should wait for the next storage message

                                    ReceiveMessage();

                                }

                                else

                                {

                                    // all c-get responses are finished or error occured

                                   

                                    // send a release request

                                    SendReleaseRq();

                                   

                                    // wait for release response

                                    ReceiveMessage();

                                }

                            }

                            else if (dicomProtocolMessage.DicomMessage.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.CSTORERQ)

                            {

                                // Thread will come here when remote scp sends a store request

                                // The whole dataset contains the dicom file dataset..

                                // you can create a dicom file here using a DicomFile class and set its dataset to a clone of recieved message.

                               

                                DvtkHighLevelInterface.Dicom.Files.DicomFile file = new DvtkHighLevelInterface.Dicom.Files.DicomFile();

                                file.DataSet.CloneFrom(dicomProtocolMessage.DicomMessage.DataSet);

                                file.FileMetaInformation.MediaStorageSOPClassUID = "...."; // read it from dataset

                                file.FileMetaInformation.MediaStorageSOPInstanceUID = "...."; // read it from dataset

                                file.Write("where you want to save the file");

                                file.DataSet.Clear();

                                file = null;

 

                                // then you should wait for a c-get response

                                ReceiveMessage();

                            }

                        }

                    }

                }

 

 

/// 

 

in your application :

myCgetSCU scu = new myCgetSC();

myCgetSCU.Start();


Posted on: 2011/1/24 14:55
Transfer the post to other applications Transfer
Topic | Forum


Re: Stopping MessageIterators ?
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline

 

Additional question :


Does HliScp class make some sort of validation stuff in the background?? Is there anything i can do to optimize its performace.

Here are the options i already set :

this.realSCU.Options.StorageMode = Dvtk.Sessions.StorageMode.NoStorage;

this.realSCU.Options.GenerateDetailedResults = false;     

this.realSCU.Options.LogChildThreadsOverview = false;            

this.realSCU.Options.LogThreadStartingAndStoppingInParent = false;

this.realSCU.Options.LogWaitingForCompletionChildThreads = false;

this.realSCU.Options.ShowResults = false;

this.realSCU.Options.StartAndStopResultsGatheringEnabled = false;


Posted on: 2010/12/10 8:07
Transfer the post to other applications Transfer
Topic | Forum


Re: System.IO.IOException: The file exists
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
Additional information;
If there is not enough space on the disk drive, library also goes into FileNotFound exception.

Posted on: 2010/12/10 7:52
Transfer the post to other applications Transfer
Topic | Forum


Stopping MessageIterators ?
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline

Hi. What is the proper way of stopping MessageIterator or MessageIterator based classes without causing an exception?? (such as HliScp ..)

When i call Stop() or StopCurrentThread() methods, it goes into a DicomMessageRecieve Exception because of its socket has been closed.

When i digg in the source codes, i noticed the "recieveMessage" variable and i understood that if i only set that variable to a "false" value, the internal while loop would release itself. But that didn't happen either. 

Right now, i am  handling the exception with a "try catch" statement on "base.Execute()"  line, and in the catch statement i am checking if Stop() command was calledor not before exception. But since application works multi threaded and hundreds of SCP classes are generated, those exceptions are quite disturbing.

Shortly; what is the best way of stopping the port listener without causing any Exception???


Posted on: 2010/12/10 7:43
Transfer the post to other applications Transfer
Topic | Forum


Re: memory to process huge number of files
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
I don't know how exactly things works out inside Dvtk libraries, but maybe defining only one single dicomFile variable can be useful about this, you should try it.

Class MainDicomThread
Inherits DicomThread

Dim theDicomFile As DicomFile = Nothing;

Protected Overrides Sub Execute()

If theDicomFile Is Nothing Then
theDicomFile = New DicomFile
End If

theDicomFile.Read("C:\Temp\001.dcm")
theDicomFile.DataSet.Set("0x00100030", VR.DA, "19990202")
theDicomFile.Write("C:\Temp\001_changed.dcm")

End Sub

End Class ' MainDicomThread

Posted on: 2010/11/12 10:28
Transfer the post to other applications Transfer
Topic | Forum


Re: Querying for series doesn't work
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
Have you tried requesting series information in a new association?

Posted on: 2010/11/12 10:20
Transfer the post to other applications Transfer
Topic | Forum


Re: Retrieving attribute name
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
Yes, maybe definition files was not loaded properly. I'll check that out again..

Our main purpose is not to determine the field type. We need it for something like making a user friendly tags properties window.

For example:

0010,0010 - PN - "Patient Name" - Value=John White
0010,0020 - LO - "Patient ID" - Value=123456789

Posted on: 2010/9/6 9:24
Transfer the post to other applications Transfer
Topic | Forum


Re: v3.1.0.2 DvtkManagedCodeAdaptor.dll Reference Problem on Windows XP or 2003.
Quite a regular
Joined:
2010/3/23 15:01
Group:
Registered Users
Posts: 24
Level : 3; EXP : 62
HP : 0 / 65
MP : 8 / 607
Offline
Hi marco.

I've tried what you said, used the release build of Dvtk and release build of my application. But it is still the same even with those latest 3.1.4 version.

The strange thing is; if i copy the "DvtkManagedCodeAdaptor.dll" from old version 3.0.6 directory and use it with new 3.1.4 DLL's, my application starts working again.

What exactly that dll for?? Is it some kind of C#<->C++ wrapper?? And would that be ok if i use old 3.0.6 version "DvtkManagedCodeAdaptor.dll" with new 3.1.4 version other Dvtk DLL's ??

There is another topic here about this subject:
http://www.dvtk.org/modules/newbb/vie ... php?topic_id=451&forum=10
And i see you say you currently don't know what causes this error. But i'll be glad if you consider this problem as a critical work item and i hope you'll find the main reason soon.

Posted on: 2010/8/28 11:41
Transfer the post to other applications Transfer
Topic | Forum



 Top
(1) 2 3 »



[Advanced Search]