Jump to content
 

Recommended Posts

UPDATE:

🎉🎉Found the fix and now have functional dilation extraction going. 🎉🎉

-----------------------------------------------------------

SRanipalEye_FunctionLibrary.cpp

bool USRanipalEye_FunctionLibrary::GetPupilDiameter(EyeIndex eye, float& diameter_mm)
{
	return SRanipalEye_Core::Instance()->GetPupilDiameter(eye, diameter_mm);
}

SRanipalEye_Core.cpp

bool SRanipalEye_Core::GetPupilDiameter(EyeIndex eye, float &diameter_mm)
{
	bool valid = false;
	if (SRanipalEye_Framework::Instance()->GetStatus() == SRanipalEye_Framework::FrameworkStatus::NOT_SUPPORT) {
		valid = true;
		diameter_mm = 0.0f;
	}
	else {
		UpdateData();

		Eye::SingleEyeData eyeData;
		switch (SRanipalEye_Framework::Instance()->GetEyeVersion())
		{
		case SupportedEyeVersion::version1:
			eyeData = eye == EyeIndex::LEFT ? EyeData_.verbose_data.left : EyeData_.verbose_data.right;
			break;
		case SupportedEyeVersion::version2:
			eyeData = eye == EyeIndex::LEFT ? EyeData_v2.verbose_data.left : EyeData_v2.verbose_data.right;
			break;
		}

		valid = eyeData.GetValidity(Eye::SingleEyeDataValidity::SINGLE_EYE_DATA_PUPIL_DIAMETER_VALIDITY);
		if (valid) {
			diameter_mm = eyeData.pupil_diameter_mm;
		}
		else
			diameter_mm = 0.0f;
	}
	return valid;
}

SRanipal_Core.h

	bool GetPupilDiameter(EyeIndex eye, float& diameter_mm);

SRanipalEye_FunctionLibrary.h

UFUNCTION(BlueprintCallable, Category = "SRanipal|Eye")
		static bool GetPupilDiameter(EyeIndex eye, float& diameter_mm);

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...