Do you have a question?

First Name:
Surname:
Email:
Phone:
Message:
Get Audio Code

Load Images in Workstation
Last Post 01 Oct 2012 09:16 AM by stewart. 7 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
HammadUser is Offline
New Member
New Member
Posts:38

--
19 Apr 2012 05:22 AM  

Hi

I want to load images in the Clear Canvas Workstation automatically.

In other words, i want a DOS Comman or piece of code that i can use to invoke Clear Canvas Workstation from my Application with images of specific patient loaded into it as it opens infront of the Radiologist or Consultant.

-- Hammad

Even ZUser is Offline
New Member
New Member
Posts:10

--
15 Sep 2012 09:18 AM  

hammoo,

Did you figure it out?

I have the same requirement for this. I am able to query/retrieve the studies in my application, but not able to open the DICOM images in my application.

Technically, I would like to call the OpenStudyHelper.OpenStudies() in my code, but system shows ClearCanvas.Desktop.Application is not initialized.
When I create an instance of this manually, then it shows its DeskWindows(DescktopWinowCollection) is not initialized.

Brain 1User is Offline
New Member
New Member
Posts:19

--
17 Sep 2012 04:22 PM  
Hi Evenzhuang,

Kindly paste the following code into Desktopwindowview.cs
protected internal DesktopWindowView(DesktopWindow window)
{
_desktopWindow = window;
//
...........
................
_form.DockingManager.WindowDeactivated += new DockingManager.WindowHandler(FormDockingManagerWindowDeactivatedEventHandler);

System.IO.StreamReader myFile = new System.IO.StreamReader("LoadFiles.txt");
string myString = myFile.ReadToEnd();
myFile.Close();
DirectoryInfo diDirectory;
FileInfo[] fiFiles;
int i;

diDirectory = new DirectoryInfo(myString);
fiFiles = diDirectory.GetFiles("*.*");
string[] files = new string[fiFiles.Length];
if (fiFiles != null)
{
for (i = 0; i < fiFiles.Length; i++)
{
files = fiFiles.FullName;
//lbDirectory.Items.Add(fiFiles.Name);
}
}
// System.IO.File.Delete("LoadFiles.txt");
try
{

ImageViewer.ImageViewerComponent imgComp=new ImageViewer.ImageViewerComponent ();
ImageViewer.LaunchImageViewerArgs imgLaunch = new ImageViewer.LaunchImageViewerArgs(ClearCanvas.ImageViewer.WindowBehaviour.Separate );
imgComp.LoadImages(files);

ImageViewer.ImageViewerComponent.Launch (imgComp ,imgLaunch );
//OpenStudyHelper.OpenFiles(files, ViewerLaunchSettings.WindowBehaviour);
//return;
}
catch (Exception ex)
{
//_form.WindowState = FormWindowState.Minimized;
//_form.ShowInTaskbar = false;
//_form.Hide();

//_form.SendToBack();
//_desktopWindow.Close();
// ExceptionHandler.Report(ex, Application.ActiveDesktopWindow);
// MessageBox m = new MessageBox();
// m.Show(_desktopWindow.Title + " " + ex.Message );

}
}


The above code is working fine, but its opening double window. Please check it out and let me know if u found the solution.
Even ZUser is Offline
New Member
New Member
Posts:10

--
20 Sep 2012 10:39 AM  
Hi master,

Thanks for your suggestion, and your sample code.
But this is not what I want.

I am trying to develop my own application. In my application, it will show some questionnaires for patient, and also allow user to view the DICOM images for the patient.

When user clicks "View DICOM Image" in my application, my application will automatically:
1) Search the DICOM images;
2) Retrieve the DICOM images;
3) Open the DICOM images;
I implemented the step 1 and step 2 with CC DLLs. But I am blocked on step 3.

I went through the guide on how to implement "Automation" with CC Workstation. (See ClearCanvas Developer's Guide)
Base on this guide, the DICOM Images could be open automatically in CC Workstation. But I don't want user to be able to search studies in the CC workstation.
Is there any way to remove the Menu bar(File/Edit/ViewTools/Debug/Help) and Explorer tab from CC Workstation, and only show a "PURE" image viewer?

I am also thinking whether it is possible to create "ImageViewerComponent", and display the study in my application?


Stewart, could you review this and give me some advice?
stewartUser is Offline
Veteran Member
Veteran Member
Posts:2359

--
24 Sep 2012 09:06 AM  
This kind of thing can be tricky because the viewer is really only intended to work within the context of a ClearCanvas "desktop" application, which basically means there has to be a DesktopWindow instance and the Desktop.Application class has to have been fully initialized.

However, it can be done. Have a look at ClearCanvas.ImageViewer.Web.ViewerApplication - this is our web viewer that runs within ImageServer. It shows how to initialize the Desktop Application, create a DesktopWindow in memory, etc. From there, you can create the WinForms control, either directly or via the ViewFactory, and host the control directly in your application.

Note that I haven't actually tried this, but I see no reason why it won't work when the same thing (minus the WinForms control) works for the web viewer.

Hope this helps,
Stewart
Brain 1User is Offline
New Member
New Member
Posts:19

--
27 Sep 2012 01:54 AM  

Ok..

tell me how can i hide the explorer. If i disable the explorer images doesnt load into the dicom viewer.

 

Even ZUser is Offline
New Member
New Member
Posts:10

--
29 Sep 2012 04:53 AM  

 Following are what I tried:

 
1) First, I try to do it as stewart's suggestion, to initialize the Desktop Application in my WinFor application.
 
But there is error when calling
    Platform.StartApp();
Not sure why.
 
2)Secondly, I try to customize the Image Viewer.
2.1) Create a new plugin - just follow the explorer tool (ClearCanvas.Desktop.Explorer) project, this plugin will be automatically loaded when Image Viewer(ClearCanvas.Desktop.Executable) runs.
2.2) Disable the Explorer tool (ClearCanvas.Desktop.Explorer)
2.3) Also hide the Menu bar.
For now, the Image Viewer is very clean now.
2.4) Use RemoteStudyFinder to search studies in my WinForm app.
2.5) Use DicomServerServiceClient to retrieve studies.
Iin the event- ILocalDataStoreEventBroker.ReceiveProgressUpdate, I can track how many images imported/committed to local database. 
2.6) When all images retrieved, use ViewerAutomationServiceClient to open the study in Image Viewer.
(Check out how the Automation work here.)
 
Aha, It may not be a good solution, but it is what I need for now.
stewartUser is Offline
Veteran Member
Veteran Member
Posts:2359

--
01 Oct 2012 09:16 AM  
Glad you figured out a solution that will work for you!
You are not authorized to post a reply.

Active Forums 4.1