0

I want to build a plugin with fiji, where I input an avi video/frame sequences of grayscale and output the avi/frames with no black frames (remove them). I though of recording a macro for that. I downloaded an avi video and imported the frames to fiji. How can i record the process above to give me the results I want? I am new to Fiji. Thank you in advance

Kenan Morani
  • 141
  • 1
  • 9

1 Answers1

1

If you are happy with an ImageJ-macro, here is what I would do:

requires( "1.53t" );
path = File.openDialog( "Choose an AVI-file." );
run( "AVI...", "select="+path+" avi="+path+" use" );
cnt = 0;
for ( i=1; i<=nSlices; i++ ) { 
   setSlice( i );
   if ( getValue( "Mean" ) < 1 ) {
      run( "Delete Slice" );
      cnt++;
   }
}
setSlice( 1 );
name = File.getNameWithoutExtension( path );
saveAs( "avi", File.getDirectory( path ) + name + "_woBlank" );
//close();
exit( ""+cnt+" blank frames removed." );
Herbie
  • 143
  • 5