Hi All,
I am trying to write a basic DICOM VIewer with Zoom, Pan, WIndow Level / Window Width using ClearCanvas. Managed to write Load Images , and apply PAN and Window Level/ Window Width. But when I try to implement zoom , it does work for me. The Scale value does not change irrespective of values been set. Have attached the code snippet
LocalSopDataSource _sop = new LocalSopDataSource("C:\\DcmFile\\001.dcm");
ImageSop imageSop = new ImageSop(_sop);
IEnumerable images = PresentationImageFactory.Create(imageSop);
foreach (IPresentationImage image in images)
{
ISpatialTransformProvider spatial = image as ISpatialTransformProvider;
spatial.SpatialTransform.Scale = 3;
bitmap = image.DrawToBitmap(256, 256);
}
Am I doing any wrong here. I also tried to get image as ImageSpatialTransform but it returned null for me.
ImageSpatialTransform spatial = image as ImageSpatialTransform;
It would be great if someone can help me out.
Thanks and Regards
R.Alagaraja