Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 3, 2009 6:26:59 PM(UTC)
yourfriend20030

Groups: Registered
Posts: 59


Hi everyone!
I am writing a Application that allows user to edit data(here Patient Information such as PatientName, PatientAddress...) then save that edited data to that very file.
My problem here is that I am displaying that dicom file. so when I save data using CurrentDicomDataset.Save(_FileName, DicomDataSetSaveFlags.None) It will give me error: Error when writting to file(I guess that this file is being used by my Application so that It can not allow to edit).
So, Can you give me how to free a file(here Dicom file) so that I can save or rename it while still displaying to me.
----------------------------------------
ps: I have tried
DicomEngine.Startup();
Support.Unlock(false);
but not success
-----------------
Thanks in advance!
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, February 4, 2009 7:35:24 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

What is the exact error that you are receiving? Are you saving the DICOM to the same file name? If you try to save to a different file name, do you receive an error?
Can you provide me with more information regarding this issue?
 
#3 Posted : Wednesday, February 4, 2009 4:20:30 PM(UTC)
yourfriend20030

Groups: Registered
Posts: 59


Of course the same file name!
so if you can give me some tips or ways to overcome this problem. Such as How to free that file from MedicalViewer(or from RasterCodecs ) Because I load this Image by using :
_codecs.Load(fileName)
-------------------
thanks in Advance
 
#4 Posted : Thursday, February 5, 2009 6:51:10 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

You should be able to use the RasterCodecs to load and save the same file name. However, regarding the DicomDataSet Load method, you must pass the DicomDataSetLoadFlags as  LoadAndClose. If you do this, the complete dataset will be loaded into memory and the file handle closed.
For more information, please check the .NET help files.
 
#5 Posted : Sunday, February 8, 2009 9:42:40 PM(UTC)
yourfriend20030

Groups: Registered
Posts: 59


Here is my code in C#
RasterImage _image = _codecs.Load(fileName);
_medicalViewer.Cells.Insert(_medicalViewer.Cells.Count, new MedicalViewerCell(_image, true, 1, 1));

DicomDataSet ds = new DicomDataSet();
ds.Load(fileName, DicomDataSetLoadFlags.LoadAndClose);

//Now I will update Patient_Name=NewName
ds.SetStringValue(ds.FindFirstElement(null, DicomTag.PatientName, false), "NewName", DicomCharacterSetType.UnicodeInUtf8);
//I save it to that file
ds.Save(fileName, DicomDataSetSaveFlags.None);
//The Save Method will raise Error : Error to writing a file
So can you tell me more so that I can save my new information to the very file that is opening in MedicalViewer
Thanks again!
 
#6 Posted : Sunday, February 8, 2009 10:04:25 PM(UTC)
yourfriend20030

Groups: Registered
Posts: 59


Thank I have solved my problem as you guide.
And Now I have a new Problem that is not answered by your staff. Can you help me solving this
------------------------------------
Here is my new problem:

I am facing a new problem when saving new Dicom file. Below is my details:
- I have a multipage Dicom Image(called as Image1 with 19 pages) and I am using MedicalViewer to display it. The Image can obtain from: _medicalViewer.Cells[CellIndex].Image.
- Next I have another multipage Dicom Image(called as Image2 with 16 pages). Then I add Image2 into Image1 by using the code like: _medicalViewer.Cells[CellIndex].Image.AddPages(_Image2 , 1, _Image2 .PageCount)
- After combining 2 images into one. I have a new Image with total of 35 pages.
- Now I want to save new Image of 35 page. But When I use the code of saving it in Medical Viewer Demo Example of LeadTools V16:
codecs.Save(image,
_fileName,
_format,
_bitsPerPixel,
image.Page,
image.PageCount,
_savePageNumber,
_pageMode)

- myCodecs is RasterCodecs
- image is _medicalViewer.Cells[CellIndex].Image of 35 pages
-fileName=C:\\newImg.Dcm
- format=DicomColor
-_bitsPerPixel=24
-image.Page=1
-image.PageCount=35
-_savePageNumber=1
-_pageMode=Overwrite

After saving I open new Image but the page of Image is not 35 pages. I don't know why it is.
Can you tell me what i have to do before saving it so that I obtain new Image with 35 pages.
Also in case that I add many multipage image into an existing Image(not only 2 images above)
Thanks in advance!
 
#7 Posted : Monday, February 9, 2009 5:22:00 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

My colleague has already answered the forum post below that you made. Please refer to that post for technical support regarding this issue.
http://support.leadtools.com/SupportPortal/CS/forums/26670/ShowPost.aspx
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.150 seconds.