@@ -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"
0 commit comments