public void CreatPABeamSet(ProbeModel probe) { IDeviceConfiguration deviceConfiguration = device.GetConfiguration(); ultrasoundConfiguration = deviceConfiguration.GetUltrasoundConfiguration(); digitizerTechnology = ultrasoundConfiguration.GetDigitizerTechnology(UltrasoundTechnology.PhasedArray); IBeamSetFactory beamSetFactory = digitizerTechnology.GetBeamSetFactory(); var beamFormations = GetBeamFormationCollection(beamSetFactory, probe); beamSet = beamSetFactory.CreateBeamSetPhasedArray("Phased Array", beamFormations); }
public IBeamFormationCollection GetFocusedBeamFormationCollection( IBeamSetFactory beamSetFactory, ProbeModel probe, double[] elementDelays) { var beamFormations = beamSetFactory.CreateBeamFormationCollection(); uint usedElementPerBeam = probe.UsedElementsPerBeam; uint totalElements = probe.TotalElements; // Add Focused beam formations for (uint beamIndex = 0; beamIndex < totalElements - usedElementPerBeam + 1; beamIndex++) { var beamFormation = beamSetFactory.CreateBeamFormation( usedElementPerBeam, usedElementPerBeam, beamIndex + 1, beamIndex + 1); // Add element delays var pulserDelays = beamFormation.GetPulserDelayCollection(); var receiverDelays = beamFormation.GetReceiverDelayCollection(); for (uint elemIndex = 0; elemIndex < usedElementPerBeam; elemIndex++) { // Add pulser delay pulserDelays.GetElementDelay(elemIndex).SetElementId(elemIndex + beamIndex + 1); pulserDelays.GetElementDelay(elemIndex).SetDelay(elementDelays[elemIndex]); //Add receiver delay receiverDelays.GetElementDelay(elemIndex).SetElementId(elemIndex + beamIndex + 1); receiverDelays.GetElementDelay(elemIndex).SetDelay(elementDelays[elemIndex]); } beamFormations.Add(beamFormation); } // Add unfocused beam formations for (uint beamIndex = 0; beamIndex < totalElements - usedElementPerBeam + 1; beamIndex++) { var beamFormation = beamSetFactory.CreateBeamFormation( usedElementPerBeam, usedElementPerBeam, beamIndex + 1, beamIndex + 1); beamFormations.Add(beamFormation); } return(beamFormations); }
// Calculate element positions public static List <Point> GetElementsPosition(ProbeModel probe) { List <Point> positions = new List <Point>(); uint elemNum = probe.UsedElementsPerBeam; double pitch = probe.Pitch; double range = pitch * (elemNum - 1); double midRange = range / 2; for (uint i = 0; i < elemNum; i++) { Point e = new Point(i * pitch - midRange, 0); positions.Add(e); } for (int i = 0; i < positions.Count; i++) { Debug.WriteLine($"Element {i} position: X={positions[i].X} Y ={positions[i].Y}"); } return(positions); }
public IBeamFormationCollection GetSscanBeamFormationCollection( IBeamSetFactory beamSetFactory, ProbeModel probe, double[][] elementDelays) // sscan delay 2-d array { var beamFormations = beamSetFactory.CreateBeamFormationCollection(); uint usedElementPerBeam = probe.UsedElementsPerBeam; uint totalElements = probe.TotalElements; // Add Focused beam formations for (uint beamIndex = 0; beamIndex < elementDelays.GetLength(0); beamIndex++) { var beamFormation = beamSetFactory.CreateBeamFormation( usedElementPerBeam, usedElementPerBeam, 1, // pulser element starts from 1 1); // receiver element starts from 1 // Add element delays var pulserDelays = beamFormation.GetPulserDelayCollection(); var receiverDelays = beamFormation.GetReceiverDelayCollection(); for (uint elemIndex = 0; elemIndex < usedElementPerBeam; elemIndex++) { // Add pulser delay pulserDelays.GetElementDelay(elemIndex).SetElementId(elemIndex + 1); // element starts from 1 pulserDelays.GetElementDelay(elemIndex).SetDelay(elementDelays[beamIndex][elemIndex]); //Add receiver delay receiverDelays.GetElementDelay(elemIndex).SetElementId(elemIndex + 1); // element starts from 1 receiverDelays.GetElementDelay(elemIndex).SetDelay(elementDelays[beamIndex][elemIndex]); } beamFormations.Add(beamFormation); } return(beamFormations); }
public IBeamFormationCollection GetBeamFormationCollection(IBeamSetFactory beamSetFactory, ProbeModel probe) { var beamFormations = beamSetFactory.CreateBeamFormationCollection(); uint usedElementPerBeam = probe.UsedElementsPerBeam; uint totalElements = probe.TotalElements; for (uint beamIndex = 0; beamIndex < totalElements - usedElementPerBeam + 1; beamIndex++) { var beamFormation = beamSetFactory.CreateBeamFormation( usedElementPerBeam, usedElementPerBeam, beamIndex + 1, beamIndex + 1); beamFormations.Add(beamFormation); } return(beamFormations); }