Skip to content

Anurag-Gade/Overlap-based-Masking-Scheme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overlap-based Masking Scheme

Masking schemes tend to be vital in various computer vision tasks, for the purpose of marking a particular region of interest we intend the algorithm to act upon. Here, we propose a labelled and a binary cuboidal masking scheme with the option of providing an overlapping factor for the sub-cuboids.

Given the path to the volume file along with the output path to store the generated outputs, the provided input will be masked with overlaps. However, the default parameters can be tweaked according to varying use cases. Here, the number of sub-cuboids to be generated needs to be specified by the number of sub-cuboids in each axis. For example, if 12 sub-cuboids are required to be generated, the input parameters specifying the number of sub-cuboids need to have a product of the total number of sub-cuboids to be generated, which is 12 in this case. A possible option could be 2 sub-cuboids along the x-axis, 2 sub-cuboids along the y-axis, and 3 sub-cuboids along the z-axis (or any other combination whose product is 12). By default, the number of sub-cuboids to be generated is set as 8 (2 sub-cuboids along each of the three axes).

The framework provides a flexibility to adjust the overlapping factor, which is the magnitude of overlapping a sub-cuboid and its adjacent sub-cuboid must have. By default the overlapping factor is set to 8. An overlapping factor of 8 implies, that the overall overlap is 8 indices "wide", or 4 indices wide on the left half and 4 indices wide on the right half.

The generated binary mask also has an option to be segregated and saved in the sub-folders corresponding the the sub-cuboid. This functionality is enabled by the segregate flag, which is set to False by default.

The outputs generated by the proposed framework include a labelled mask (each sub-cuboid is labelled by its number) and a binary mask consisting of only 0s and 1s.

Below is an example of the terminal input;

>>> python main.py --input_path <str> --out_folder <str> --sub_cuboids_along_x <int> --sub_cuboids_along_y <int> --sub_cuboids_along_z <int> --overlap <int> --segregate <bool>

Arguments:

  • input_path (type:str) -- The absolute path to the volume file intended to mask should be provided in this argument.
  • out_folder (type:str) -- The absolute path to the directory in which the outputs are to be saved.
  • sub_cuboids_along_x (type:int, optional, default:2) -- The number of sub-cuboids the overall volume needs to be partitioned into along the x-axis.
  • sub_cuboids_along_y (type:int, optional, default:2) -- The number of sub-cuboids the overall volume needs to be partitioned into along the y-axis.
  • sub_cuboids_along_z (type:int, optional, default:2) -- The number of sub-cuboids the overall volume needs to be partitioned into along the z-axis.
  • overlap (type:int, optional, default:8) -- The overlapping factor by which each sub-cuboid will overlap with its adjacent partitions.
  • segregate (type:bool, optional, default:False) -- Flag to enable segregation in the script, if enabled the binary mask is segregated into its constituent sub-cuboids and saved in seperate folders.

In case of any issues or bugs encountered, please write to me at: [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published