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 : Friday, October 7, 2016 4:08:23 AM(UTC)

ehk  
ehk

Groups: Registered
Posts: 12


Why MedicalViewerMultiCell doesn't work from a seperate class to generate cut-planes as below in SingleCutPlane() function?

//MedicalViewerMultiCell doesn't work via Seperate class
Code:
public class personalizedCell : MedicalViewerMultiCell
{
	public personalizedCell() : base()
	{
	}
}


Code:
private void SingleCutPlane()
{
	personalizedCell _parentCell = new personalizedCell();     //This line gives exception because of class personalizedCell.
        //MedicalViewerMultiCell  _parentCell  = new MedicalViewerMultiCell();    //This line works good, but I will be missing my personalized properties.

	_parentCell.Data3DRequested += new EventHandler<MedicalViewerData3DRequestedEventArgs>(cell_Data3DRequested);
	_parentCell.Data3DFrameRequested += new EventHandler<MedicalViewer3DFrameRequestedEventArgs>(cell_Data3DFrameRequested);
			
	MedicalViewerCell singleDerivativeCell = new MedicalViewerCell();

	_parentCell.ReferenceLine.CutLines.Add(new MedicalViewerPlaneCutLine(singleDerivativeCell));

	_medicalViewer.Cells.Add(singleDerivativeCell);
	_medicalViewer.Cells.Add(_parentCell);
}



Code:
personalizedCell _parentCell = new personalizedCell();     //This line gives exception because of 'class personalizedCell'.
//MedicalViewerMultiCell  _parentCell  = new MedicalViewerMultiCell();    //This line works good, but I will be missing my personalized properties.

Edited by user Tuesday, October 11, 2016 6:16:05 AM(UTC)  | Reason: add code tag

 

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 : Tuesday, October 11, 2016 4:41:09 PM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 171

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

I tried out the code you pasted in the MedicalViewerDemo and was able to successfully instantiate an instance of the personalizedCell without modifying any of your code, so the issue is likely with something specific to your application or due to missing dependencies.

In order to proceed further can you please provide me with the exact exception that you are getting on the constructor as well as which DLLs you are referencing in your application?

Please note that you need the Leadtools.MedicalViewer.dll as well as the Leadtools.Annotations.Core.dll in order to create a new MedicalViewerMultiCell since the MedicalViewerMultiCell derives from the MedicalViewerCell which derives from the MedicalViewerBaseCell which implements IAnnAutomationControl:

Code:
public class MedicalViewerMultiCell : MedicalViewerCell
public class MedicalViewerCell : MedicalViewerBaseCell
public class MedicalViewerBaseCell : Control, INotifyPropertyChanged, IAnnAutomationControl
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Wednesday, October 12, 2016 4:54:32 AM(UTC)

ehk  
ehk

Groups: Registered
Posts: 12


Thank you for you information. We are using the libraries you mentioned. But still getting the following exception :

Code:
System.NullReferenceException occurred
  Message=  Object reference not set to an instance of an object.
  Source=Leadtools.Medical3D
  StackTrace:
       bij Leadtools.Medical3D.Medical3DEngine.Provide3DInformation(MedicalViewerData3DRequestedEventArgs data)
  InnerException: 


The above exception occurs on the following line of code :

Code:
_parentCell.ReferenceLine.CutLines.Add(new MedicalViewerPlaneCutLine(singleDerivativeCell));


We 've noticed that the property _informationType is set to the value CutPlaneImage in the beginning and with the usage of personalizedCell class, while this property should be Create3DObject at the begining.
 
#4 Posted : Friday, October 14, 2016 9:46:08 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 171

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

That exception is not an issue with your derived class but rather with your code in your application.

There is an example of using the MedicalViewerPlaneCutLine class in the documentation here:

https://www.leadtools.co...lviewerplanecutline.html

The NullReference Exception indicates that you are trying to access member fields, or function types, on an object reference that points to null. So you need to debug your code and see what is null when it shouldn't be.
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
#5 Posted : Wednesday, March 29, 2017 2:52:59 AM(UTC)

ehk  
ehk

Groups: Registered
Posts: 12


Hello,

I have tested again and I have still problem with creating cutplanes when I try to use overal a derived class which implements MedicalViewerMultiCell as below.

Code:

public class personalizedCell : MedicalViewerMultiCell
{
	public personalizedCell() : base()
	{
	}
}



The type of following _parentCell is also a derived class which implements MedicalViewerMultiCell as above.

Code:
_parentCell.ReferenceLine.CutLines.Add(cutLine);



The following code throws NullReferenceException :

Code:

private void personalizedCell_Data3DRequested(object sender, MedicalViewerData3DRequestedEventArgs e)
{
      e.Succeed = Leadtools.Medical3D.Medical3DEngine.Provide3DInformation(e);
}


When I use MedicalViewerMultiCell as cell type without any derived class, then it works fine. But I can't add our customized properties directly to MedicalViewerMultiCell cell.

It seems that cutplane functionality internally cheks cell type and it should be nothing else than MedicalViewerMultiCell.

 
#6 Posted : Friday, March 31, 2017 12:50:13 PM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 171

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

In order to help you solve this issue, I will need a sample application that reproduces this issue. If your class is deriving from the MedicalViewerMultiCell, then essentially it is a MedicalViewerMultiCell, therefore the cutplane's internal functionality will work as expected. It is likely that there is some initialization steps that are missed when you use your own constructor vs. using the base class constructor.

You can post a sample application as an attachment to a reply to my post, or you can send it via email. I went ahead and have already sent you an email from support@leadtools.com to the email address that you registered on the forum. If that email address is not correct, please update it and let me know so I can resend the email.

Please reply to my post or email with the sample project and we will debug it and help resolve this issue.

Let me know if you have any other questions in the meantime.

Thanks,
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
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-2017, Yet Another Forum.NET
This page was generated in 0.222 seconds.