In this tutorial, you will learn how to display a reference line in the Medical Viewer Cells.
On the Add Reference dialog, select the Browse tab, and add the following DLLs:
Switch to Form1 code view (right-click Form1 in the solution explorer then select View Code ) and add the following lines at the beginning of the file:
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.MedicalViewerImports Leadtools.Medical3DImports Leadtools.Dicom
using Leadtools;using Leadtools.Codecs;using Leadtools.MedicalViewer;using Leadtools.Medical3D;using Leadtools.Dicom;
In Form1, create a new method InitClass(). Add the following code in the InitClass() method:
Private Sub InitClass()Dim MY_LICENSE_FILE As String = "d:\temp\TestLic.lic"' Unlock DICOM supportDim MY_DicomDEVELOPER_KEY As String = "xyz123abc"RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DicomDEVELOPER_KEY);' Unlock Medical supportDim MY_MedicalDEVELOPER_KEY As String = "abc123xyz"RasterSupport.SetLicense(MY_LICENSE_FILE, MY_MedicalDEVELOPER_KEY);' Unlock Medical 3D supportDim MY_3DDEVELOPER_KEY As String = "123xyzabc"RasterSupport.SetLicense(MY_LICENSE_FILE, MY_3DDEVELOPER_KEY);' Create a new instance of the Codecs class, which will be used to load the images.Dim _codecs As RasterCodecs = New RasterCodecs()' Create a new instance of the Medical Viewer. The layout will be divided to 2X2.Dim viewer As MedicalViewer = New MedicalViewer(2, 2)' Fit the view to the whole formviewer.Dock = DockStyle.Fill' Add the viewer to the formControls.Add(viewer)End Sub
void InitClass(){string MY_LICENSE_FILE = "d:\\temp\\TestLic.lic";// Unlock DICOM supportstring MY_DicomDEVELOPER_KEY = "xyz123abc";RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DicomDEVELOPER_KEY);// Unlock Medical supportstring MY_MedicalDEVELOPER_KEY = "abc123xyz";RasterSupport.SetLicense(MY_LICENSE_FILE, MY_MedicalDEVELOPER_KEY);// Unlock Medical 3D supportstring MY_3DDEVELOPER_KEY = "123xyzabc";RasterSupport.SetLicense(MY_LICENSE_FILE, MY_3DDEVELOPER_KEY);// Create a new instance of the Codecs class, which will be used to load the images.RasterCodecs _codecs = new RasterCodecs();// Create a new instance of the Medical Viewer. The layout will be divided to 2X2.MedicalViewer viewer = new MedicalViewer(2, 2);// Fit the view to the whole formviewer.Dock = DockStyle.Fill;// Add the viewer to the formControls.Add(viewer);}
Note: For more information on how to acquire the above unlock keys, please contact LEAD Technologies support.
Call the InitClass method from inside the Form1 constructor and place the call after InitializeComponent();
Note: Now you will need to have DICOMDIR files for the next step. You can download a sample from our site. Download the file from here (Download chest_ct_compressed_subset_for_3d_tutorial.zip), and extract the file to "C:\Leadtools_DICOMDIR". For more information on building 3D objects from a DICOMDIR, please see Loading a DICOMDIR To Create a 3D Object.
Note: If you encounter an "Invalid File Format" or "Feature Not Supported" exception, please refer to the topic Invalid File Format/Feature Not Supported.
Download the sample DICOMDIR and decompress the contents to the folder: C:\Leadtools_DICOMDIR.
Add the following code to the Form1 class. This code is for loading the images from the DICOMDIR, sorting them and extracting all the useful information:
Private _studyElement As DicomElementPrivate _seriesElement As DicomElementPrivate _seriesManager As MedicalViewerSeriesManagerPrivate _imageDataList As List(Of MedicalViewerImageData)Private doubleArray As Double()Private patientElement As DicomElementPrivate referenceUID As StringPrivate imageElement As DicomElementPrivate output As MedicalViewerSeriesManager' Find the study using the Study instance UID, and return its DicomElement if the study is foundPrivate Function FindStudy(ByVal ds As DicomDataSet, ByVal studyInstanceUID As String) As DicomElement' get the parent element.Dim patientElement As DicomElement = ds.GetFirstKey(Nothing, True)Dim studyElement As DicomElement = NothingDim studyInformationElement As DicomElement = NothingDim studyID As StringstudyElement = ds.GetChildKey(patientElement)studyElement = ds.GetChildElement(studyElement, True)Do While Not studyElement Is NothingstudyInformationElement = ds.FindFirstElement(studyElement, DicomTag.StudyInstanceUID, True)If Not studyInformationElement Is Nothing ThenstudyID = ds.GetConvertValue(studyInformationElement)If studyID = studyInstanceUID ThenReturn studyInformationElementEnd IfEnd IfstudyElement = ds.GetNextKey(studyElement, True)studyElement = ds.GetChildElement(studyElement, True)LoopReturn NothingEnd Function' Find the series using the Series instance UID, and return its DicomElement if the series is foundPrivate Function FindSeries(ByVal ds As DicomDataSet, ByVal studyElement As DicomElement, ByVal seriesInstanceUID As String) As DicomElementDim seriesElement As DicomElement = NothingDim seriesInformationElement As DicomElement = NothingDim seriesID As StringseriesElement = ds.GetChildKey(studyElement)seriesElement = ds.GetChildElement(seriesElement, True)Do While Not seriesElement Is NothingseriesInformationElement = ds.FindFirstElement(seriesElement, DicomTag.SeriesInstanceUID, True)If Not seriesInformationElement Is Nothing ThenseriesID = ds.GetConvertValue(seriesInformationElement)If seriesID = seriesInstanceUID ThenReturn seriesInformationElementEnd IfEnd IfseriesElement = ds.GetNextKey(seriesElement, True)seriesElement = ds.GetChildElement(seriesElement, True)LoopReturn NothingEnd Function' return the first frame's filename of the series.Private Function GetFirstImageName(ByVal ds As DicomDataSet, ByVal seriesElement As DicomElement, ByVal directoryPath As String, <System.Runtime.InteropServices.Out()> ByRef imageElement As DicomElement) As StringDim imageIDElement As DicomElement = NothingimageElement = ds.GetChildKey(seriesElement)imageElement = ds.GetChildElement(imageElement, True)Do While Not imageElement Is NothingimageIDElement = ds.FindFirstElement(imageElement, DicomTag.ReferencedFileID, True)If Not imageIDElement Is Nothing ThenReturn directoryPath &"\" & ds.GetConvertValue(imageIDElement)End IfLoopReturn ""End Function' return the next frame's filename of the series.Private Function GetNextImageName(ByVal ds As DicomDataSet, ByVal directoryPath As String, ByRef imageElement As DicomElement) As StringDim nextImageElement As DicomElement = NothingimageElement = ds.GetNextKey(imageElement, True)imageElement = ds.GetChildElement(imageElement, True)Do While Not imageElement Is NothingnextImageElement = ds.FindFirstElement(imageElement, DicomTag.ReferencedFileID, True)If Not imageElement Is Nothing ThenDim echoElement As DicomElement = ds.FindFirstElement(imageElement, DicomTag.EchoNumber, True)Return directoryPath & "\" & ds.GetConvertValue(nextImageElement)End IfLoopReturn ""End Function' This will load the DICOM dataset information and save it into a new instance of the class MedicalViewerImageData.Private Function AddImageToImageArray(ByVal ds As DicomDataSet, ByVal index As Integer, ByVal imagePath As String, <System.Runtime.InteropServices.Out()> ByRef echoNumber As Integer) As BooleanechoNumber = -1Dim imageData As MedicalViewerImageData = New MedicalViewerImageData()patientElement = ds.FindFirstElement(Nothing, DicomTag.ImagePositionPatient, True)doubleArray = ds.GetDoubleValue(patientElement, 0, 3)imageData.ImagePosition = Point3D.FromDoubleArray(doubleArray)imageData.Data = imagePathimageData.EchoNumber = echoNumberpatientElement = ds.FindFirstElement(Nothing, DicomTag.FrameOfReferenceUID, True)referenceUID = ds.GetConvertValue(patientElement)imageData.FrameOfReferenceUID = referenceUIDpatientElement = ds.FindFirstElement(Nothing, DicomTag.ImageOrientationPatient, True)imageData.ImageOrientation = ds.GetConvertValue(patientElement)patientElement = ds.FindFirstElement(Nothing, DicomTag.PixelSpacing, True)doubleArray = ds.GetDoubleValue(patientElement, 0, 2)imageData.PixelSpacing = New Point2D(CSng(doubleArray(0)), CSng(doubleArray(1)))patientElement = ds.FindFirstElement(Nothing, DicomTag.InstanceNumber, True)If Not patientElement Is Nothing ThenimageData.InstanceNumber = Convert.ToInt32(ds.GetConvertValue(patientElement))End IfpatientElement = ds.FindFirstElement(Nothing, DicomTag.InstanceCreationTime, True)If Not patientElement Is Nothing ThenimageData.CaptureTime = Convert.ToDateTime(ds.GetConvertValue(patientElement))End If_imageDataList.Add(imageData)Return TrueEnd FunctionPublic Function Load_James_CT_Localizer() As MedicalViewerSeriesManagerDim fileName As String = "C:\Leadtools_DICOMDIR\Miller James\"Dim studyInstanceUID As String = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000022"Dim seriesInstanceUID As String = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000023"Return LoadSeries(fileName, studyInstanceUID, seriesInstanceUID, 1)End FunctionPublic Function Load_James_CT() As MedicalViewerSeriesManagerDim fileName As String = "C:\Leadtools_DICOMDIR\Miller James\"Dim studyInstanceUID As String = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000022"Dim seriesInstanceUID As String = "1.3.12.2.1107.5.1.4.50772.30000009122208215356200001997"Return LoadSeries(fileName, studyInstanceUID, seriesInstanceUID, 256)End Function' this will load the series specified by the seriesInstanceUID and studyInstanceUID from the file specified in fileNamePrivate Function LoadSeries(ByVal fileName As String, ByVal studyInstanceUID As String, ByVal seriesInstanceUID As String, ByVal count As Integer) As MedicalViewerSeriesManagerDicomEngine.Startup()Dim ds As DicomDataSet = New DicomDataSet()ds.Load(fileName &"DICOMDIR", DicomDataSetLoadFlags.None)Dim directoryPath As String = fileName' Here the program will search for the study with the specified studyInstanceUID._studyElement = FindStudy(ds, studyInstanceUID)' Here the program will search for the series with the specified seriesInstanceUID._seriesElement = FindSeries(ds, _studyElement, seriesInstanceUID)' create a new instance of the MedicalViewerSeriesManager which will be used to sort the images, in order to create the correct 3D object._seriesManager = New MedicalViewerSeriesManager()' create an array of MedicalViewerImageData. This class will be used to save the frame information. The information will be used to sort the images._imageDataList = New List(Of MedicalViewerImageData)()Dim dicomDataSet As DicomDataSetDim imageIndex As IntegerDim imagePath As StringDim echoNumber As Integer = 0' Now the program will go through each frame in the seriesimagePath = GetFirstImageName(ds, _seriesElement, directoryPath, imageElement)imageIndex = 0Do While imageIndex < countTry' each image in the series will be loaded.dicomDataSet = New DicomDataSet()dicomDataSet.Load(imagePath, DicomDataSetLoadFlags.None)' The program will load its information and save it into a new instance of the class MedicalViewerImageData.AddImageToImageArray(dicomDataSet, imageIndex, imagePath, echoNumber)dicomDataSet.Dispose()' go to the next image.imagePath = GetNextImageName(ds, directoryPath, imageElement)Catch exception As System.ExceptionSystem.Diagnostics.Debug.Assert(False, exception.Message)ThrowEnd TryimageIndex += 1Loop' sort the images, based on its data._seriesManager.Sort(_imageDataList)DicomEngine.Shutdown()Return _seriesManagerEnd FunctionPrivate Sub LoadLocalizer(ByVal cell As MedicalViewerMultiCell)' start up the codecs, which allows loading various images.Dim _codecs As RasterCodecs = New RasterCodecs()' Load the CT localizer.output = Load_James_CT_Localizer()cell.Image = _codecs.Load(CStr(output.Localizers(0).LocalizerData.Data), 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1)' the following three lines are important to set. Otherwise, wrong reference line results can occur.' set the image position of the localizer.cell.SetImagePosition(0, _seriesManager.Localizers(0).LocalizerData.ImagePosition, True)' set the image orientation of the localizer.cell.ImageOrientation = _seriesManager.Localizers(0).LocalizerData.ImageOrientationArray' set the pixel spacing of the localizer.cell.PixelSpacing = _seriesManager.Localizers(0).LocalizerData.PixelSpacing' set the frame reference UID of the localizer. This will create a reference line between the series and the localizer if they have the same reference UIDcell.FrameOfReferenceUID = _seriesManager.Localizers(0).LocalizerData.FrameOfReferenceUIDEnd SubPrivate Sub Load2DCell(ByVal cell As MedicalViewerMultiCell)' start up the codecs, which allows loading various images.Dim _codecs As RasterCodecs = New RasterCodecs()' Load the CT DICOMDIR and return arranged stack of images.output = Load_James_CT()' loop through the images and add them one by one to the final imageDim image As RasterImage = NothingDim depth As Integer = output.Stacks(0).Items.CountDim index As Integerindex = 0Do While index < depthIf image Is Nothing Thenimage = _codecs.Load(CStr(output.Stacks(0).Items(index).Data), 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1)Elseimage.AddPage(_codecs.Load(CStr(output.Stacks(0).Items(index).Data), 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1))End Ifindex += 1Loopcell.Image = image' the following lines are important to set. otherwise, wrong reference line results may occur.index = 0Do While index < depth' set the image position of the each frame.cell.SetImagePosition(index, _seriesManager.Stacks(0).Items(index).ImagePosition, False)index += 1Loop' set the image orientation of the series, this is set once, since all the frames must have the same orientation value.cell.ImageOrientation = _seriesManager.Stacks(0).Items(0).ImageOrientationArray' set the pixel spacing of the series, this is set once, since all the frames must have the same pixel spacing value.cell.PixelSpacing = _seriesManager.Stacks(0).Items(0).PixelSpacing' set the frame reference UID of the series. This will create a reference line between the series and the localizer if they have the same reference UIDcell.FrameOfReferenceUID = _seriesManager.Stacks(0).Items(0).FrameOfReferenceUIDEnd Sub
DicomElement _studyElement;DicomElement _seriesElement;MedicalViewerSeriesManager _seriesManager;List<MedicalViewerImageData> _imageDataList;double[] doubleArray;DicomElement patientElement;string referenceUID;DicomElement imageElement;MedicalViewerSeriesManager output;// Find the study using the Study instance UID, and return its DicomElement if the study is foundprivate DicomElement FindStudy(DicomDataSet ds, string studyInstanceUID){// get the parent element.DicomElement patientElement = ds.GetFirstKey(null, true);DicomElement studyElement = null;DicomElement studyInformationElement = null;string studyID;studyElement = ds.GetChildKey(patientElement);studyElement = ds.GetChildElement(studyElement, true);while (studyElement != null){studyInformationElement = ds.FindFirstElement(studyElement,DicomTag.StudyInstanceUID,true);if (studyInformationElement != null){studyID = ds.GetConvertValue(studyInformationElement);if (studyID == studyInstanceUID)return studyInformationElement;}studyElement = ds.GetNextKey(studyElement, true);studyElement = ds.GetChildElement(studyElement, true);}return null;}// Find the series using the Series instance UID, and return its DicomElement if the series is foundprivate DicomElement FindSeries(DicomDataSet ds, DicomElement studyElement, string seriesInstanceUID){DicomElement seriesElement = null;DicomElement seriesInformationElement = null;string seriesID;seriesElement = ds.GetChildKey(studyElement);seriesElement = ds.GetChildElement(seriesElement, true);while (seriesElement != null){seriesInformationElement = ds.FindFirstElement(seriesElement,DicomTag.SeriesInstanceUID,true);if (seriesInformationElement != null){seriesID = ds.GetConvertValue(seriesInformationElement);if (seriesID == seriesInstanceUID)return seriesInformationElement;}seriesElement = ds.GetNextKey(seriesElement, true);seriesElement = ds.GetChildElement(seriesElement, true);}return null;}// return the first frame's filename of the series.private string GetFirstImageName(DicomDataSet ds, DicomElement seriesElement, string directoryPath, out DicomElement imageElement){DicomElement imageIDElement = null;imageElement = ds.GetChildKey(seriesElement);imageElement = ds.GetChildElement(imageElement, true);while (imageElement != null){imageIDElement = ds.FindFirstElement(imageElement,DicomTag.ReferencedFileID,true);if (imageIDElement != null){return directoryPath + "\\" + ds.GetConvertValue(imageIDElement);}}return "";}// return the next frame's filename of the series.private string GetNextImageName(DicomDataSet ds, string directoryPath, ref DicomElement imageElement){DicomElement nextImageElement = null;imageElement = ds.GetNextKey(imageElement, true);imageElement = ds.GetChildElement(imageElement, true);while (imageElement != null){nextImageElement = ds.FindFirstElement(imageElement,DicomTag.ReferencedFileID,true);if (imageElement != null){DicomElement echoElement = ds.FindFirstElement(imageElement,DicomTag.EchoNumber,true);return directoryPath + "\\" + ds.GetConvertValue(nextImageElement);}}return "";}// This will load the DICOM dataset information and save it into a new instance of the class MedicalViewerImageData.private bool AddImageToImageArray(DicomDataSet ds, int index, string imagePath, out int echoNumber){echoNumber = -1;MedicalViewerImageData imageData = new MedicalViewerImageData();patientElement = ds.FindFirstElement(null,DicomTag.ImagePositionPatient,true);doubleArray = ds.GetDoubleValue(patientElement, 0, 3);imageData.ImagePosition = Point3D.FromDoubleArray(doubleArray);imageData.Data = imagePath;imageData.EchoNumber = echoNumber;patientElement = ds.FindFirstElement(null,DicomTag.FrameOfReferenceUID,true);referenceUID = ds.GetConvertValue(patientElement);imageData.FrameOfReferenceUID = referenceUID;patientElement = ds.FindFirstElement(null,DicomTag.ImageOrientationPatient,true);imageData.ImageOrientation = ds.GetConvertValue(patientElement);patientElement = ds.FindFirstElement(null,DicomTag.PixelSpacing,true);doubleArray = ds.GetDoubleValue(patientElement, 0, 2);imageData.PixelSpacing = new Point2D((float)doubleArray[0], (float)doubleArray[1]);patientElement = ds.FindFirstElement(null,DicomTag.InstanceNumber,true);if (patientElement != null)imageData.InstanceNumber = Convert.ToInt32(ds.GetConvertValue(patientElement));patientElement = ds.FindFirstElement(null,DicomTag.InstanceCreationTime,true);if (patientElement != null)imageData.CaptureTime = Convert.ToDateTime(ds.GetConvertValue(patientElement));_imageDataList.Add(imageData);return true;}public MedicalViewerSeriesManager Load_James_CT_Localizer(){string fileName = @"C:\Leadtools_DICOMDIR\Miller James\";string studyInstanceUID = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000022";string seriesInstanceUID = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000023";return LoadSeries(fileName, studyInstanceUID, seriesInstanceUID, 1);}public MedicalViewerSeriesManager Load_James_CT(){string fileName = @"C:\Leadtools_DICOMDIR\Miller James\";string studyInstanceUID = "1.3.12.2.1107.5.1.4.50772.30000009122208074910900000022";string seriesInstanceUID = "1.3.12.2.1107.5.1.4.50772.30000009122208215356200001997";return LoadSeries(fileName, studyInstanceUID, seriesInstanceUID, 256);}// this will load the series specified by the seriesInstanceUID and studyInstanceUID from the file specified in fileNameprivate MedicalViewerSeriesManager LoadSeries(string fileName, string studyInstanceUID, string seriesInstanceUID, int count){DicomEngine.Startup();DicomDataSet ds = new DicomDataSet();ds.Load(fileName + "DICOMDIR", DicomDataSetLoadFlags.None);string directoryPath = fileName;// Here the program will search for the study with the specified studyInstanceUID._studyElement = FindStudy(ds, studyInstanceUID);// Here the program will search for the series with the specified seriesInstanceUID._seriesElement = FindSeries(ds, _studyElement, seriesInstanceUID);// create a new instance of the MedicalViewerSeriesManager which will be used to sort the images, in order to create the correct 3D object._seriesManager = new MedicalViewerSeriesManager();// create an array of MedicalViewerImageData. this class will be used to save the frame information. these information will be used to sort the images._imageDataList = new List<MedicalViewerImageData>();DicomDataSet dicomDataSet;int imageIndex;string imagePath;int echoNumber = 0;// Now the program will go through each frame in the seriesimagePath = GetFirstImageName(ds, _seriesElement, directoryPath, out imageElement);for (imageIndex = 0; imageIndex < count; imageIndex++){try{// each image in the series will be loaded.dicomDataSet = new DicomDataSet();dicomDataSet.Load(imagePath, DicomDataSetLoadFlags.None);// The program will load its dcinformation and save it into a new instance of the class MedicalViewerImageData.AddImageToImageArray(dicomDataSet, imageIndex, imagePath, out echoNumber);dicomDataSet.Dispose();// go to the next image.imagePath = GetNextImageName(ds, directoryPath, ref imageElement);}catch (System.Exception exception){System.Diagnostics.Debug.Assert(false, exception.Message);throw;}}// sort the images, based on its data._seriesManager.Sort(_imageDataList);DicomEngine.Shutdown();return _seriesManager;}void LoadLocalizer(MedicalViewerMultiCell cell){// start up the codecs, which allows loading various images.RasterCodecs _codecs = new RasterCodecs();// Load the CT localizer.output = Load_James_CT_Localizer();cell.Image = _codecs.Load((string)output.Localizers[0].LocalizerData.Data, 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1);// the following three lines are important to set. otherwise, wrong reference line results may occur.// set the image position of the localizer.cell.SetImagePosition(0, _seriesManager.Localizers[0].LocalizerData.ImagePosition, true);// set the image orientation of the localizer.cell.ImageOrientation = _seriesManager.Localizers[0].LocalizerData.ImageOrientationArray;// set the pixel spacing of the localizer.cell.PixelSpacing = _seriesManager.Localizers[0].LocalizerData.PixelSpacing;// set the frame reference UID of the localizer. This will create a reference line between the series and the localizer if they have the same reference UIDcell.FrameOfReferenceUID = _seriesManager.Localizers[0].LocalizerData.FrameOfReferenceUID;}void Load2DCell(MedicalViewerMultiCell cell){// start up the codecs, which allows loading various images.RasterCodecs _codecs = new RasterCodecs();// Load the CT DICOMDIR and return arranged stack of images.output = Load_James_CT();// loop through the images and add them one by one to the final imageRasterImage image = null;int depth = output.Stacks[0].Items.Count;int index;for (index = 0; index < depth; index++){if (image == null){image = _codecs.Load((string)output.Stacks[0].Items[index].Data, 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1);}elseimage.AddPage(_codecs.Load((string)output.Stacks[0].Items[index].Data, 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1));}cell.Image = image;// the following lines are important to set. otherwise, wrong reference line results may occur.for (index = 0; index < depth; index++){// set the image position of the each frame.cell.SetImagePosition(index, _seriesManager.Stacks[0].Items[index].ImagePosition, false);}// set the image orientation of the series, this is set once, since all the frames must have the same orientation value.cell.ImageOrientation = _seriesManager.Stacks[0].Items[0].ImageOrientationArray;// set the pixel spacing of the series, this is set once, since all the frames must have the same pixel spacing value.cell.PixelSpacing = _seriesManager.Stacks[0].Items[0].PixelSpacing;// set the frame reference UID of the series. This will create a reference line between the series and the localizer if they have the same reference UIDcell.FrameOfReferenceUID = _seriesManager.Stacks[0].Items[0].FrameOfReferenceUID;}
Add the following at the end of the InitClass() method (this will create a new cell and fill it with a specified series:
' Create the cell that will hold the stack of images.Dim cell As MedicalViewerMultiCell = New MedicalViewerMultiCell()' Load the stack of images.Load2DCell(cell)
// Create the cell that will hold the stack of images.MedicalViewerMultiCell cell = new MedicalViewerMultiCell();// Load the stack of images.Load2DCell(cell);
Add the following at the end of the InitClass() method (this will create a new cell and fill it with a single frame which is called a localizer):
' Create the cell that will hold the localizer.Dim localizerCell As MedicalViewerMultiCell = New MedicalViewerMultiCell()' load the localizerLoadLocalizer(localizerCell)
// Create the cell that will hold the localizer.MedicalViewerMultiCell localizerCell = new MedicalViewerMultiCell();// load the localizerLoadLocalizer(localizerCell);
Now add both cells (the series cell and the localizer cell to the MedicalViewer), to do this add the following at the end of the InitClass():
' Add the multi frame cell above to the MedicalViewer.viewer.Cells.Add(cell)' Add the localizer cell above to the MedicalViewer.viewer.Cells.Add(localizerCell)
// Add the multi frame cell above to the MedicalViewer.viewer.Cells.Add(cell);// Add the localizer cell above to the MedicalViewer.viewer.Cells.Add(localizerCell);
Finally, you need to enable the reference line for both cell, to do this, simply add the following lines at the end of your InitClass() method:
' enable the reference line in the localizer image.cell.ReferenceLine.Enabled = True' enable the reference line in the stack image.localizerCell.ReferenceLine.Enabled = True
// enable the reference line in the localizer image.cell.ReferenceLine.Enabled = true;// enable the reference line in the stack image.localizerCell.ReferenceLine.Enabled = true;