Medical3DContainer Constructor()

Summary
Initializes a new instance of the class Medical3DContainer with default parameters.
Syntax
C#
C++/CLI
public: 
Medical3DContainer(); 
Remarks
  • A folder called "Temp3DFolder" will be added to the C: drive which will contain the temporary 3D data.
  • In case of any unexpected errors which prevents the program of freeing the temporary data, You must remove this temporary data manually
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.MedicalViewer; 
using Leadtools.Medical3D; 
 
public void Medical3DControlExample() 
{ 
   Medical3DLoadDICOMSeriesExamples LoadObject = new Medical3DLoadDICOMSeriesExamples(); 
   MedicalViewerSeriesManager output = LoadObject.LoadJamesHead(); 
 
   MainForm1 form = new MainForm1(output); 
   form.ShowDialog(); 
} 
 
// MainForm1 will be the owner of the medical viewer control. 
class MainForm1 : Form 
{ 
   //private Medical3DControl _medical3DControl; 
 
   private Control _control; 
   private Medical3DContainer container; 
 
   public MainForm1(MedicalViewerSeriesManager output) 
   { 
      RasterCodecs _codecs = new RasterCodecs(); 
      RasterImage _image; 
 
      CodecsImageInfo codecsInformation; 
 
      _control = new Control(); 
 
      this.SizeChanged += new EventHandler(MainForm1_SizeChanged); 
      this.FormClosing += new FormClosingEventHandler(MainForm1_FormClosing); 
 
      container = new Medical3DContainer(); 
 
      container.Objects.Add(new Medical3DObject()); 
 
      int index; 
 
      codecsInformation = _codecs.GetInformation((string)output.Stacks[0].Items[0].Data, true); 
 
 
      int width = codecsInformation.Width; 
      int height = codecsInformation.Height; 
      int depth = 256; 
 
      container.Objects[0].MemoryEfficientInit(depth); 
 
      for (index = 0; index < depth; index++) 
      { 
 
         _image = _codecs.Load((string)output.Stacks[0].Items[index].Data, 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1); 
         container.Objects[0].MemoryEfficientSetFrame(_image, index, output.Stacks[0].Items[index].ImagePosition, true); 
      } 
 
      string spearator = ("\\"); 
      string[] test = output.Stacks[0].Items[0].ImageOrientation.Split(spearator.ToCharArray()); 
      float[] orientation = new float[6]; 
      int i; 
      for (i = 0; i < 6; i++) 
      { 
         orientation[i] = (float)Convert.ToDouble(test[i]); 
      } 
 
      container.Objects[0].MemoryEfficientEnd(orientation, output.Stacks[0].PixelSpacing); 
 
      Controls.Add(_control); 
 
      _control.Paint += new PaintEventHandler(_control_Paint); 
      _control.SizeChanged += new EventHandler(_control_SizeChanged); 
 
   } 
 
   void MainForm1_FormClosing(object sender, FormClosingEventArgs e) 
   { 
      container.Dispose(); 
   } 
 
   void _control_SizeChanged(object sender, EventArgs e) 
   { 
      container.Render(_control); 
   } 
 
   void _control_Paint(object sender, PaintEventArgs e) 
   { 
      container.Render(_control); 
   } 
 
 
 
   void MainForm1_SizeChanged(object sender, EventArgs e) 
   { 
      if (_control != null) 
      { 
         _control.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
         container.Render(_control); 
      } 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.24
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical3D Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.