Copy images from a SortedList to another SortedList
For the whole process I use multichannel images (Zeiss *.czi's). Certain channels are extracted and for further processing stored in a SortedList (named origImageList).
On the extracted channels various filters are applied and finally the number of objects is determined. Also modified channels are stored in a SortedList (named modImageList). During the process the modImageList is cleared and the origImageList should copied to the modImageList to start a new process.
The problem is that lists only store references and not values. I tried out different "DeepCopy" solutions like serialization without any success. Look at the simple APP.
How can I transfer contents of a SortedList to another SortedList without a reference?Thanks in advance
fsup
fsup
0
Best Answer
-
Hi fsup,
I checked your project. All your collections contain references to images. If you want to keep 2 different collections, one original and another modified, you should create copies of these images using Duplicate function, like that:' transfer to modImageList and apply for example lowpass filter For Each kvp In origImageList newInt = kvp.Key newIm = DirectCast(kvp.Value, McImage) newIm =newIm.Duplicate(mcImageCreateFlags.mcicfNotVisible Or mcImageCreateFlags.mcicfNoAddToCollection) LowPassFilterProcessing(newIm, 500, 1) modImageList.Add(newInt, newIm) Next
Please let me know if that's what you wanted.
Yuri
0
Answers
-
Thank you. That is great. This is exactly that what i am looking for.fsup0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions