private void UpdateGeneralMaskOptions(RegistrationParameters parameters) { if (radioButtonOnlyFixedMask.Checked) { parameters.UseFixedMask = true; parameters.UseMovingMask = false; } else if (radioButtonOnlyMovingMask.Checked) { parameters.UseFixedMask = false; parameters.UseMovingMask = true; } else if (radioButtonFixedAndMovingMask.Checked) { parameters.UseFixedMask = true; parameters.UseMovingMask = true; } else { parameters.UseFixedMask = false; parameters.UseMovingMask = false; } if (radioButtonWholeTissue.Checked) { parameters.UseInnerStructuresSegmentation = false; } else if (radioButtonInnerStructures.Checked) { parameters.UseInnerStructuresSegmentation = true; } }
private void PopulateLoadingParameters(RegistrationParameters registrationParameters) { if (FixedMaskFilename != null && File.Exists(FixedMaskFilename)) { registrationParameters.UseFixedMaskFromDisk = true; registrationParameters.FixedMaskFromDisk = FixedMaskFilename; } if (MovingMasksFilenames.Count > 0) { bool filesExist = true; MovingMasksFilenames.ForEach(it => filesExist &= File.Exists(it)); if (filesExist) { registrationParameters.UseMovingMasksFromDisk = true; registrationParameters.MovingMasksFromDisk = MovingMasksFilenames; } } if (MovingImageCoefficientMaps.Count > 0) { bool filesExist = true; MovingImageCoefficientMaps.ForEach(it => filesExist &= File.Exists(it)); if (filesExist) { registrationParameters.UseCoefficientMapsFromDisk = true; registrationParameters.CoefficientMapsFromDisk = MovingImageCoefficientMaps; } } }
/// <summary> /// Initializes a new instance of the <see cref="StreamDeckClient" /> class. /// </summary> /// <param name="registrationParameters">The registration parameters.</param> /// <param name="logger">The optional logger.</param> public StreamDeckClient(RegistrationParameters registrationParameters, ILogger logger = null) { this.EventRouter = new StreamDeckEventRouter(logger); this.RegistrationParameters = registrationParameters; this.WebSocket = new ClientWebSocketWrapper($"ws://localhost:{registrationParameters.Port}/", DEFAULT_JSON_SETTINGS); this.WebSocket.MessageReceived += this.WebSocket_MessageReceived; }
public NavComAction( ILogger <NavComAction> logger, IImageLogic imageLogic, IFlightConnector flightConnector, IEventRegistrar eventRegistrar, IEventDispatcher eventDispatcher, EnumConverter enumConverter) { registration = new RegistrationParameters(Environment.GetCommandLineArgs()[1..]);
private void UpdateMiscOptions(RegistrationParameters registrationParametersNonRigid) { if (checkBoxJaccobian.Checked) { registrationParametersNonRigid.ComputeJaccobian = true; } else if (checkBoxUseCoefficientmap.Checked) { } }
public IActionResult GetRegisterToken(RegistrationParameters parameters) { //RegistrationParameters parameter = new RegistrationParameters() //{ // CompanyId = "someId", // Position = "Sales", // Role = "User" //}; string token = _userService.GenerateRegistrationToken(parameters); return(Json(new { token = token })); }
public async Task <IActionResult> RegistrationAttachments(RegistrationParameters parameters) { if (parameters.Face != null || parameters.Voice != null) { if (parameters.Face != null) { byte[] imageBytes; await using (var ms = new MemoryStream()) { await parameters.Face.CopyToAsync(ms); imageBytes = ms.ToArray(); } await _fileProxy.Upload(new FileUploadParameters { Bytes = imageBytes, StaffId = parameters.StaffId, Type = FileType.Face }); } if (parameters.Voice != null) { byte[] voiceBytes; await using (var ms = new MemoryStream()) { await parameters.Voice.CopyToAsync(ms); voiceBytes = ms.ToArray(); } await _fileProxy.Upload(new FileUploadParameters { Bytes = voiceBytes, StaffId = parameters.StaffId, Type = FileType.Voice }); } var result = await _staffProxy.Activate(parameters.StaffId); if (result != null) { _emailSender.Send(new EmailSendParameter { ToAddress = parameters.Email, Subject = "TickIT Registration", Body = "Hello!"//need user name }); } return(RedirectToAction("Login")); } return(View()); }
/// <summary> /// Get output directory from registration parameters and optional iteration. /// </summary> /// <param name="parameters">params</param> /// <param name="i">iteration</param> /// <returns>output directory</returns> public static string GetOutputDirectory(RegistrationParameters parameters, int i = -1) { string path = Path.Combine(ApplicationContext.OutputPath, parameters.SubDirectory); if (i != -1) { path = Path.Combine(path, i.ToString()); } if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } return(path); }
private void UpdatePenalty(RegistrationParameters parameters) { if (radioButtonNoPenalties.Checked) { parameters.Penaltyterm = PenaltyTerm.None; } else if (radioButtonTransformRigidity.Checked) { parameters.SetTransformPenaltyTerm(); } else if (radioButtonBendEnergy.Checked) { parameters.SetTransformBendingEnergy(); } else if (radioButtonDistancePreserving.Checked) { parameters.SetDistancePreservingRigidityPenalty(); } }
public string GenerateRegistrationToken(RegistrationParameters parameters) { var claims = new List <Claim> { new Claim(RegistrationParameters.CompanyClaim, parameters.CompanyId.ToString()), new Claim(RegistrationParameters.RoleClaim, parameters.Role), new Claim(RegistrationParameters.PositionClaim, parameters.Position), }; var now = DateTime.UtcNow; var jwt = new JwtSecurityToken( issuer: RegisterTokenOptions.ISSUER, audience: RegisterTokenOptions.AUDIENCE, notBefore: now, claims: claims, expires: now.Add(TimeSpan.FromMinutes(RegisterTokenOptions.LIFETIME)), signingCredentials: new SigningCredentials(RegisterTokenOptions.GetSymmetricSecurityKey(), SecurityAlgorithms.HmacSha256)); var encodedJwt = new JwtSecurityTokenHandler().WriteToken(jwt); return(encodedJwt); }
private void UpdateRigidMaskOptions(RegistrationParameters parameters) { if (radioButtonRigidNoMasking.Checked) { parameters.RigidOptions = MaskedRigidRegistrationOptions.None; } else if (radioButtonMaskWhole.Checked) { parameters.RigidOptions = MaskedRigidRegistrationOptions.BinaryRegistrationWholeTissue; parameters.UseInnerStructuresSegmentation = false; } else if (radioButtonMaskInner.Checked) { parameters.RigidOptions = MaskedRigidRegistrationOptions.BinaryRegistrationInnerStructures; parameters.UseInnerStructuresSegmentation = true; } else if (radioButtonComponent.Checked) { parameters.RigidOptions = MaskedRigidRegistrationOptions.ComponentwiseRegistration; } }
public async Task <UserModel> RegisterUser(RegisterModel model, RegistrationParameters parameters) { var user = _mapper.Map <RegisterModel, User>(model); user.Role = parameters.Role; user.Position = parameters.Position; user.CompanyId = parameters.CompanyId; user.RegisterDate = DateTime.UtcNow; if (model.Image != null) { var imageRepository = _storage.GetFileRepository(FileTypeEnum.Image); using (MemoryStream ms = new MemoryStream()) { await model.Image.CopyToAsync(ms); user.ImageId = await imageRepository.Save(ms, model.Image.FileName); } } await _userRepository.Create(user); return(_mapper.Map <User, UserModel>(user)); }
private void UpdateRigidRegistrationType(RegistrationParameters parameters) { if (parameters.ParamMapToUse == null) { if (radioButtonTranslation.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.translation); } else if (radioButtonSimilarity.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.similarity); } else if (radioButtonRigid.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.rigid); } else if (radioButtonAffine.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.affine); } } parameters.SubDirectory = parameters.RegistrationDefaultParams + "_" + DateTime.Now.ToShortDateString(); }
private void UpdateNonRigidRegistrationType(RegistrationParameters parameters) { if (parameters.ParamMapToUse == null) { if (radioButtonAdvancedBspline.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.bspline); } else if (radioButtonBsplineDiffusion.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.diffusion); parameters.NonRigidOptions = MaskedNonRigidRegistrationOptions.DiffuseRegistration; } else if (radioButtonKernelSpline.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.spline); } else if (radioButtonSplineRecursive.Checked) { SetRegistrationParameterMap(parameters, RegistrationDefaultParameters.recursive); } } parameters.SubDirectory = parameters.RegistrationDefaultParams + "_" + DateTime.Now.ToShortDateString(); }
private void GatherGeneralParameters(RegistrationParameters parameters) { parameters.Order = GetRegistrationOrder(); UpdateGeneralMaskOptions(parameters); }
/// <summary> /// Initializes a new instance of the <see cref="StreamDeckClient"/> class. /// </summary> /// <param name="args">The arguments.</param> /// <param name="logger">The optional logger.</param> public StreamDeckClient(string[] args, ILogger logger = null) : this(RegistrationParameters.Parse(args), logger) { }
public EvaluationForm(RegistrationParameters parameters) { registrationParameters = parameters; InitializeComponent(); }
public void RegisterUser(String id, String username, String password, String email) { var parameters = new RegistrationParameters() { UserId = id, Username = username, Password = password, Email = email }; if (!base.WebPost<Boolean>(parameters, "Account/Register")) throw new ApplicationException("There was an error registering the user. Application is shutting down."); }
public LoadMaskForm(RegistrationParameters parametersR, RegistrationParameters parametersNR) { registrationParametersRigid = parametersR; registrationParametersNonRigid = parametersNR; InitializeComponent(); }
private void SetRegistrationParameterMap(RegistrationParameters parameters, RegistrationDefaultParameters defaultParams) { parameters.RegistrationDefaultParams = defaultParams; parameters.ParamMapToUse = RegistrationUtils.GetDefaultParameterMap(defaultParams); }
public NavComAction(ILogger <NavComAction> logger, IImageLogic imageLogic, IFlightConnector flightConnector) { registration = RegistrationParameters.Parse(Environment.GetCommandLineArgs()[1..]);
/// <summary> /// Transform a pointset for given transform parameters. /// </summary> /// <param name="transformParameters">transform params</param> /// <param name="parameters">registration params</param> /// <returns>filename of transformed point set</returns> public static string TransfromPointSet(List <sitk.VectorOfParameterMap> transformParameters, RegistrationParameters parameters, string movingImageName = null) { sitk.TransformixImageFilter transformix = null; try { transformix = new sitk.TransformixImageFilter(); transformix.SetTransformParameterMap(transformParameters.First()); transformix.LogToConsoleOn(); transformix.LogToFileOn(); transformix.SetLogFileName("transformix.log"); //transformix.SetLogToFile(true); if (transformParameters.Count > 1) { for (int i = 1; i < transformParameters.Count; i++) { var vectorParameterMap = transformParameters[i]; foreach (var paramMap in vectorParameterMap.AsEnumerable()) { transformix.AddTransformParameterMap(paramMap); } } } if (parameters.Type == RegistrationType.Rigid) { transformix.SetFixedPointSetFileName(parameters.FixedImagePointSetFilename); } else { transformix.SetFixedPointSetFileName(parameters.MovingImagePointSetFilename); } transformix.SetOutputDirectory(ReadWriteUtils.GetOutputDirectory(parameters)); //transformix.SetTransformParameter(0, "UseBinaryFormatForTransformationParameters", "true" ); var par = transformix.GetTransformParameter(0, "TransformParameters"); if (movingImageName != null) { sitk.Image movImg = ReadWriteUtils.ReadITKImageFromFile(movingImageName, sitk.PixelIDValueEnum.sitkFloat32); transformix.SetMovingImage(movImg); } sitk.Image image = transformix.Execute(); string output = ReadWriteUtils.GetOutputDirectory(parameters) + "\\outputpoints.txt"; image.Dispose(); return(output); } catch (Exception ex) { Console.WriteLine(ex); return(null); } finally { transformix.Dispose(); } }