Skip to content

Commit bf63690

Browse files
authored
Merge pull request #22 from thewtex/app-improvements
App improvements
2 parents d65bff8 + 3235ab8 commit bf63690

5 files changed

Lines changed: 39 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ configure_package_config_file(
8888
PATH_VARS CONFIG_DIR_CONFIG
8989
NO_CHECK_REQUIRED_COMPONENTS_MACRO
9090
)
91-
91+
9292
# Configure 'IntersonArraySDKCxxConfig.cmake' for an install tree
9393
set(CONFIG_DIR_CONFIG ${INSTALL_CMAKE_DIR})
9494
set( intersonArraySDKCxx_install_config ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/IntersonArraySDKCxxConfig.cmake )

app/AcquireIntersonArrayBMode.cxx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ int main( int argc, char * argv[] )
156156
std::cout << "ScanHeight = " << scanHeight << std::endl;
157157
std::cout << "MM per Pixel = " << container.GetMmPerPixel() << std::endl;
158158
std::cout << "Depth: " << depth << "mm" << std::endl;
159+
std::cout << std::endl;
159160

160161
const itk::SizeValueType framesToCollect = frames;
161162

@@ -172,10 +173,19 @@ int main( int argc, char * argv[] )
172173
imageRegion.SetSize( imageSize );
173174
image->SetRegions( imageRegion );
174175
ImageType::SpacingType imageSpacing;
175-
imageSpacing[ 0 ] = container.GetMmPerPixel();
176+
imageSpacing[ 0 ] = container.GetMmPerPixel() / 10.;
176177
imageSpacing[ 1 ] = 38.0 / (height - 1);
177-
imageSpacing[ 2 ] = 1;
178+
const short frameRate = hwControls.GetProbeFrameRate();
179+
imageSpacing[ 2 ] = 1.0 / frameRate;
178180
image->SetSpacing( imageSpacing );
181+
ImageType::DirectionType direction;
182+
direction.SetIdentity();
183+
ImageType::DirectionType::InternalMatrixType & vnlDirection = direction.GetVnlMatrix();
184+
vnlDirection.put(0, 0, 0.0);
185+
vnlDirection.put(0, 1, -1.0);
186+
vnlDirection.put(1, 0, 1.0);
187+
vnlDirection.put(1, 1, 0.0);
188+
image->SetDirection( direction );
179189
image->Allocate();
180190

181191
CallbackClientData clientData;
@@ -192,11 +202,10 @@ int main( int argc, char * argv[] )
192202
};
193203

194204
int c = 0;
195-
while( clientData.FrameIndex < framesToCollect && c < 100 )
205+
while( clientData.FrameIndex < framesToCollect && c < 10000 )
196206
{
197-
std::cout << clientData.FrameIndex << " of " << framesToCollect
207+
std::cout << "Frames to collect: " << clientData.FrameIndex << " of " << framesToCollect
198208
<< std::endl;
199-
std::cout << c << " of 100" << std::endl;
200209
Sleep( 100 );
201210
++c;
202211
}

app/AcquireIntersonArrayBMode.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@
2020
<label>Frames</label>
2121
<description>Frames to collect.</description>
2222
<longflag>frames</longflag>
23-
<flag>n</flag>
23+
<flag>n</flag>
2424
<default>1</default>
2525
</integer>
2626
<integer>
2727
<name>frequencyIndex</name>
2828
<label>Frequency Index</label>
2929
<description>Index of the frequency to examine. See the output of PrintIntersonProbeInfo.</description>
3030
<longflag>frequencyIndex</longflag>
31-
<flag>f</flag>
31+
<flag>f</flag>
3232
<default>1</default>
3333
</integer>
3434
<integer>
3535
<name>focusIndex</name>
3636
<label>Focus Index</label>
3737
<description>Index of the focus to examine. See the output of PrintIntersonProbeInfo.</description>
3838
<longflag>focusIndex</longflag>
39-
<flag>F</flag>
40-
<default>0</default>
39+
<flag>F</flag>
40+
<default>1</default>
4141
</integer>
4242
<integer>
4343
<name>highVoltage</name>
4444
<label>High Voltage</label>
4545
<description>Percentage of the high voltage for transducer excitation.</description>
4646
<longflag>highVoltage</longflag>
47-
<flag>z</flag>
47+
<flag>z</flag>
4848
<default>50</default>
4949
<minimum>0</minimum>
5050
<maximum>100</maximum>
@@ -54,7 +54,7 @@
5454
<label>Dynamic Gain</label>
5555
<description>Dynamic gain [dB].</description>
5656
<longflag>gain</longflag>
57-
<flag>g</flag>
57+
<flag>g</flag>
5858
<default>100</default>
5959
<minimum>0</minimum>
6060
<maximum>255</maximum>

app/AcquireIntersonArrayRF.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ void __stdcall pasteIntoImage( PixelType * buffer, void * clientData )
5959
}
6060

6161
const int framePixels = imageSize[0] * imageSize[1];
62-
std::cout << "frame pixels RF = " << framePixels << std::endl;
6362

6463
PixelType * imageBuffer = image->GetPixelContainer()->GetBufferPointer();
6564
imageBuffer += framePixels * callbackClientData->FrameIndex;
@@ -132,6 +131,7 @@ int main( int argc, char * argv[] )
132131
const double depth = sos * ( ns - 1 ) / ( 2 * fs );
133132
const double depthCfm = depth/2;
134133
std::cout << "Depth: " << depth << "mm" << std::endl;
134+
std::cout << std::endl;
135135

136136
container.SetRFData( true );
137137

@@ -155,8 +155,17 @@ int main( int argc, char * argv[] )
155155
ImageType::SpacingType imageSpacing;
156156
imageSpacing[ 0 ] = sos / ( 2 * fs );
157157
imageSpacing[ 1 ] = 38.0 / ( height_lines - 1 );
158-
imageSpacing[ 2 ] = 1;
158+
const short frameRate = hwControls.GetProbeFrameRate();
159+
imageSpacing[ 2 ] = 1.0 / frameRate;
159160
image->SetSpacing( imageSpacing );
161+
ImageType::DirectionType direction;
162+
direction.SetIdentity();
163+
ImageType::DirectionType::InternalMatrixType & vnlDirection = direction.GetVnlMatrix();
164+
vnlDirection.put(0, 0, 0.0);
165+
vnlDirection.put(0, 1, -1.0);
166+
vnlDirection.put(1, 0, 1.0);
167+
vnlDirection.put(1, 1, 0.0);
168+
image->SetDirection( direction );
160169
image->Allocate();
161170

162171
CallbackClientData clientData;
@@ -176,16 +185,15 @@ int main( int argc, char * argv[] )
176185
}
177186

178187
int c = 0;
179-
while( clientData.FrameIndex < framesToCollect && c < 10 )
188+
while( clientData.FrameIndex < framesToCollect && c < 10000 )
180189
{
190+
std::cout << "Frames to collect: " << clientData.FrameIndex << " of " << framesToCollect << std::endl;
181191
std::cout << clientData.FrameIndex << " of " << framesToCollect
182192
<< std::endl;
183-
std::cout << c << " of 10" << std::endl;
184193
Sleep( 100 );
185194
++c;
186195
}
187196

188-
std::cout << "StopAcquisition" << std::endl;
189197
hwControls.StopAcquisition();
190198
container.StopReadScan();
191199
Sleep( 100 ); // "time to stop"

app/AcquireIntersonArrayRF.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@
2020
<label>Frames</label>
2121
<description>Frames to collect.</description>
2222
<longflag>frames</longflag>
23-
<flag>n</flag>
23+
<flag>n</flag>
2424
<default>1</default>
2525
</integer>
2626
<integer>
2727
<name>frequencyIndex</name>
2828
<label>Frequency Index</label>
2929
<description>Index of the frequency to examine. See the output of PrintIntersonProbeInfo.</description>
3030
<longflag>frequencyIndex</longflag>
31-
<flag>f</flag>
31+
<flag>f</flag>
3232
<default>1</default>
3333
</integer>
3434
<integer>
3535
<name>focusIndex</name>
3636
<label>Focus Index</label>
3737
<description>Index of the focus to examine. See the output of PrintIntersonProbeInfo.</description>
3838
<longflag>focusIndex</longflag>
39-
<flag>F</flag>
40-
<default>0</default>
39+
<flag>F</flag>
40+
<default>1</default>
4141
</integer>
4242
<integer>
4343
<name>highVoltage</name>
4444
<label>High Voltage</label>
4545
<description>Percentage of the high voltage for transducer excitation.</description>
4646
<longflag>highVoltage</longflag>
47-
<flag>z</flag>
47+
<flag>z</flag>
4848
<default>50</default>
4949
<minimum>0</minimum>
5050
<maximum>100</maximum>

0 commit comments

Comments
 (0)