Skip to content

Commit 482a2e2

Browse files
aylwardsamuelgerber
authored andcommitted
ENH: Change API to support ArraySDK2.12 (#19)
1 parent 462fd57 commit 482a2e2

6 files changed

Lines changed: 33 additions & 61 deletions

app/AcquireIntersonArrayBMode.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,20 @@ int main( int argc, char * argv[] )
122122
hwControls.DisableHardButton();
123123

124124
ContainerType container;
125-
container.AbortScan();
126125
container.SetRFData( false );
127126

128127
const int height = hwControls.GetLinesPerArray();
129128
const int width = container.MAX_SAMPLES;
130129
const int depth = 100;
130+
const int depthCfm = 50;
131131
if( hwControls.ValidDepth( depth ) == depth )
132132
{
133133
ContainerType::ScanConverterError converterErrorIdle =
134134
container.IdleInitScanConverter( depth, width, height, probeId,
135-
steering, false, false, 0 );
135+
steering, depthCfm, false, false, 0, false );
136136
ContainerType::ScanConverterError converterError =
137-
container.HardInitScanConverter( depth, width, height, steering );
137+
container.HardInitScanConverter( depth, width, height, steering,
138+
depthCfm );
138139
if( converterError != ContainerType::SUCCESS )
139140
{
140141
std::cerr << "Error during hard scan converter initialization: "
@@ -203,7 +204,6 @@ int main( int argc, char * argv[] )
203204
hwControls.StopAcquisition();
204205
container.StopReadScan();
205206
Sleep( 100 ); // "time to stop"
206-
container.DisposeScan();
207207

208208
typedef itk::ImageFileWriter< ImageType > WriterType;
209209
WriterType::Pointer writer = WriterType::New();

app/AcquireIntersonArrayRF.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,15 @@ int main( int argc, char * argv[] )
130130
const double ns = ContainerType::MAX_RFSAMPLES; // number of samples
131131
const double fs = 30000; // [kHz]=[samples/ms] - sampling frequency
132132
const double depth = sos * ( ns - 1 ) / ( 2 * fs );
133+
const double depthCfm = depth/2;
133134
std::cout << "Depth: " << depth << "mm" << std::endl;
134135

135-
container.AbortScan();
136136
container.SetRFData( true );
137137

138138
container.IdleInitScanConverter( depth, width_samples, height_lines, probeId,
139-
steering, false, false, 0 );
140-
container.HardInitScanConverter( depth, width_samples, height_lines, steering );
139+
steering, depthCfm, false, false, 0, false );
140+
container.HardInitScanConverter( depth, width_samples, height_lines, steering,
141+
depthCfm );
141142

142143
ImageType::Pointer image = ImageType::New();
143144
typedef ImageType::RegionType RegionType;
@@ -188,7 +189,6 @@ int main( int argc, char * argv[] )
188189
hwControls.StopAcquisition();
189190
container.StopReadScan();
190191
Sleep( 100 ); // "time to stop"
191-
container.DisposeScan();
192192

193193
typedef itk::ImageFileWriter< ImageType > WriterType;
194194
WriterType::Pointer writer = WriterType::New();

include/IntersonArrayCxxImagingContainer.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ class IntersonArrayCxx_EXPORT Container
8181
};
8282

8383
ScanConverterError HardInitScanConverter( int depth, int widthScan,
84-
int heightScan, int steering );
84+
int heightScan, int steering, int depthCfm );
8585

8686
ScanConverterError IdleInitScanConverter( int depth, int width,
87-
int height, short idleId, int idleSteering, bool idleDoubler,
88-
bool idleCompound, int idleCompoundAngle );
87+
int height, short idleId, int idleSteering, int depthCfm, bool idleDoubler,
88+
bool idleCompound, int idleCompoundAngle, bool idleCfm );
8989

9090
//
9191
// Begin Capture Methods
@@ -100,10 +100,6 @@ class IntersonArrayCxx_EXPORT Container
100100

101101
bool GetScanOn() const;
102102

103-
void AbortScan();
104-
105-
void DisposeScan();
106-
107103
void StartReadScan();
108104

109105
void StartRFReadScan();

src/IntersonArrayCxxImagingContainer.cxx

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,23 @@ class ContainerImpl
243243
}
244244

245245
Container::ScanConverterError HardInitScanConverter( int depth,
246-
int widthScan, int heightScan, int steering )
246+
int widthScan, int heightScan, int steering, int depthCfm )
247247
{
248248

249249
return static_cast< Container::ScanConverterError >(
250250
WrappedScanConverter->HardInitScanConverter( depth, widthScan,
251-
heightScan, steering, WrappedCapture.get(),
251+
heightScan, steering, depthCfm, WrappedCapture.get(),
252252
WrappedImageBuilding.get() ) );
253253
}
254254

255255
Container::ScanConverterError IdleInitScanConverter( int depth,
256-
int widthScan, int heightScan, short idleId, int idleSteering,
257-
bool idleDoubler, bool idleCompound, int idleCompoundAngle )
256+
int widthScan, int heightScan, short idleId, int idleSteering, int depthCfm,
257+
bool idleDoubler, bool idleCompound, int idleCompoundAngle, bool idleCfm )
258258
{
259259
return static_cast< Container::ScanConverterError >(
260260
WrappedScanConverter->IdleInitScanConverter( depth, widthScan,
261-
heightScan, idleId, idleSteering, idleDoubler, idleCompound,
262-
idleCompoundAngle, WrappedImageBuilding.get() ) );
261+
heightScan, idleId, idleSteering, depthCfm, idleDoubler, idleCompound,
262+
idleCompoundAngle, idleCfm, WrappedImageBuilding.get() ) );
263263
}
264264

265265
//
@@ -302,16 +302,6 @@ class ContainerImpl
302302
return WrappedCapture->ScanOn;
303303
}
304304

305-
void AbortScan()
306-
{
307-
WrappedCapture->AbortScan();
308-
}
309-
310-
void DisposeScan()
311-
{
312-
WrappedCapture->DisposeScan();
313-
}
314-
315305
void StartReadScan()
316306
{
317307
WrappedCapture->StartReadScan( (ArrayType ^)Buffer );
@@ -460,21 +450,22 @@ ::GetZeroOfYScale() const
460450
Container::ScanConverterError
461451
Container
462452
::HardInitScanConverter( int depth, int widthScan, int heightScan,
463-
int steering )
453+
int steering, int depthCfm )
464454
{
465455
return Impl->HardInitScanConverter( depth, widthScan, heightScan,
466-
steering );
456+
steering, depthCfm );
467457
}
468458

469459

470460
Container::ScanConverterError
471461
Container
472462
::IdleInitScanConverter( int depth, int width, int height, short idleId,
473-
int idleSteering, bool idleDoubler, bool idleCompound,
474-
int idleCompoundAngle )
463+
int idleSteering, int depthCfm, bool idleDoubler, bool idleCompound,
464+
int idleCompoundAngle, bool idleCfm )
475465
{
476466
return Impl->IdleInitScanConverter( depth, width, height, idleId,
477-
idleSteering, idleDoubler, idleCompound, idleCompoundAngle );
467+
idleSteering, depthCfm, idleDoubler, idleCompound, idleCompoundAngle,
468+
idleCfm );
478469
}
479470

480471
//
@@ -518,22 +509,6 @@ ::GetScanOn() const
518509
}
519510

520511

521-
void
522-
Container
523-
::AbortScan()
524-
{
525-
Impl->AbortScan();
526-
}
527-
528-
529-
void
530-
Container
531-
::DisposeScan()
532-
{
533-
Impl->DisposeScan();
534-
}
535-
536-
537512
void
538513
Container
539514
::StartReadScan()

test/IntersonArrayCxxControlsHWControlsTest.cxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ int main( int argc, char * argv[] )
3838
FoundProbesType;
3939
FoundProbesType foundProbes;
4040
hwControls.FindAllProbes( foundProbes );
41+
std::cout << "Number of probes = " << foundProbes.size() << std::endl;
42+
if( foundProbes.empty() )
43+
{
44+
std::cerr << "No probes found. Please connect a probe for tests."
45+
<< std::endl;
46+
return EXIT_FAILURE;
47+
}
4148
std::cout << "Found Probes: " << std::endl;
4249
for( size_t ii = 0; ii < foundProbes.size(); ++ii )
4350
{
4451
std::cout << " " << foundProbes[ii] << std::endl;
4552
}
46-
if( foundProbes.empty() )
47-
{
48-
std::cerr << "Could not find the probe." << std::endl;
49-
return EXIT_FAILURE;
50-
}
5153

5254
hwControls.FindMyProbe( 0 );
5355
const short probeId = hwControls.GetProbeID();

test/IntersonArrayCxxImagingContainerTest.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,25 @@ int main( int argc, char * argv[] )
6565
const int height = 512;
6666

6767
int steering = 0;
68+
int depthCfm = 50;
6869
ContainerType::ScanConverterError converterError =
6970
container.IdleInitScanConverter( depth, width, height, probeId,
70-
steering, false, false, 0 );
71+
steering, depthCfm, false, false, 0, false );
7172
if( converterError != ContainerType::SUCCESS )
7273
{
7374
std::cerr << "Error during idle scan converter initialization: "
7475
<< converterError << std::endl;
7576
return EXIT_FAILURE;
7677
}
7778
converterError = container.HardInitScanConverter( depth, width,
78-
height, steering );
79+
height, steering, depthCfm );
7980
if( converterError != ContainerType::SUCCESS )
8081
{
8182
std::cerr << "Error during hard scan converter initialization: "
8283
<< converterError << std::endl;
8384
return EXIT_FAILURE;
8485
}
8586

86-
container.AbortScan();
8787
std::cout << "\nStarting BMode scanning..." << std::endl;
8888
container.StartReadScan();
8989
Sleep( 100 ); // "time to start"
@@ -99,7 +99,6 @@ int main( int argc, char * argv[] )
9999
hwControls.StopAcquisition();
100100
container.StopReadScan();
101101
Sleep( 100 ); // "time to stop"
102-
container.DisposeScan();
103102

104103
return EXIT_SUCCESS;
105104
}

0 commit comments

Comments
 (0)