Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fuse in Fiji Macro using the "default" bounding box #12

Open
Xqua opened this issue Aug 1, 2018 · 4 comments
Open

How to fuse in Fiji Macro using the "default" bounding box #12

Xqua opened this issue Aug 1, 2018 · 4 comments

Comments

@Xqua
Copy link

Xqua commented Aug 1, 2018

Hi, I'm curious on how I can make a run() statement for the fusion that will take the default bounding box that is "offered" in the BDV selection.

Basically I have a lot (90+) dataset of fixed embryos and I'm trying to automate the process instead of clicking through it 90+ times.

I know how to do it for timelapses, but not for different dataset.

So far I'm here (aka I can run the define CZI detection and registration)
But I can't seem to find a parameter set for fusion that will let me run it without a popup OR a pre defined bounding box.

Thanks !

// "BatchProcessFolders"
//

   dir = getDirectory("Choose a Directory ");
   setBatchMode(true);
   count = 0;
   countFiles(dir);
   n = 0;
   processFiles(dir);
   //print(count+" files processed");
   
   function countFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              countFiles(""+dir+list[i]);
          else
              count++;
      }
  }

   function processFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              processFiles(""+dir+list[i]);
          else {
             showProgress(n++, count);
             path = dir+list[i];
             processFile(path);
          }
      }
  }

  function processFile(path) {
       if (endsWith(path, ".czi")) {
           name = File.getName(path);
           name = substring(name, 0, lastIndexOf(name, “.”));
           params = "type_of_dataset=[Zeiss Lightsheet Z.1 Dataset (LOCI Bioformats)] xml_filename=";
           params += name;
           params += ".xml browse=";
           params += path;
           params += " first_czi=";
           params += path;
           params += " angle_1=0 angle_2=90 angle_3=180 angle_4=270 channel_1=405 channel_2=561 channel_3=488 channel_4=638 _______illumination_1=0 apply_rotation_to_dataset fix_bioformats";
           run("Define Multi-View Dataset", params);

           xml_path = substring(path, 0, lastIndexOf(path, “/”)) + "dataset.xml";
           params = "select_xml=" + xml_path + " process_angle=[All angles] process_channel=[Single channel (Select from List)] process_illumination=[All illuminations] process_timepoint=[All Timepoints] processing_channel=[channel 488] type_of_interest_point_detection=Difference-of-Gaussian label_interest_points=beads downsample_images subpixel_localization=[3-dimensional quadratic fit] interest_point_specification=[Weak & small (beads)] downsample_xy=[Match Z Resolution (less downsampling)] downsample_z=2x compute_on=[CPU (Java)]";
           run("Detect Interest Points for Registration", params);

           params = "select_xml=" + xml_path +  process_angle=[All angles] process_illumination=[All illuminations] process_timepoint=[All Timepoints] registration_algorithm=[Fast 3d geometric hashing (rotation invariant)] type_of_registration=[Register timepoints individually] interest_points_channel_405=[(DO NOT register this channel)] interest_points_channel_561=[(DO NOT register this channel)] interest_points_channel_488=beads interest_points_channel_638=[(DO NOT register this channel)] fix_tiles=[Fix first tile] map_back_tiles=[Do not map back (use this if tiles are fixed)] transformation=Affine regularize_model model_to_regularize_with=Rigid lamba=0.10 allowed_error_for_ransac=5 significance=10";
           run("Register Dataset based on Interest Points", params);

      }
  }
@StephanPreibisch
Copy link
Member

Hi, I can record it with the macro recorder like that:

run("Fuse dataset ...", "select=/Users/spreibi/Documents/Microscopy/SPIM/HisYFP-SPIM/dataset.xml process_angle=[All angles] process_channel=[All channels] process_illumination=[All illuminations] process_tile=[All tiles] process_timepoint=[All Timepoints] bounding_box=[All Views] downsampling=13 pixel_type=[32-bit floating point] interpolation=[Linear Interpolation] image=[Precompute Image] blend produce=[Each timepoint & channel] fused_image=[Display using ImageJ]");

@StephanPreibisch
Copy link
Member

the important part is: "bounding_box=[All Views]"

@Xqua
Copy link
Author

Xqua commented Aug 2, 2018 via email

@Xqua
Copy link
Author

Xqua commented Aug 6, 2018

Hi @StephanPreibisch

I'm getting an
"All views" is not a valid option error

What Macro language are you using ? (If I record my macros I also do not get a "Fuse dataset ..." I get a "Fuse/Deconvolve Dataset")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants