code: def select_output_directory(self):
          
          # Input layer
          input_layer_path = self.layer.source()
          input_file_name = os.path.basename(input_layer_path)
          input_extension = os.path.splitext(input_file_name)[1]
  
          # Get current path
          current_file_path = self.output_path_line_edit.text()
          if not current_file_path or not os.path.exists(current_file_path):
              current_file_path = input_layer_path
  
          # Filtering based on input layer
          extension_mapping = {
              '.shp': tr('Shapefile (*.shp);;'),
              '.geojson': tr('GeoJSON (*.geojson);;'),
              '.tif': tr('Raster TIF/TIFF (*.tif, *.tiff);;'),
              '.tiff': tr('Raster TIF/TIFF (*.tiff, *.tiff);;'),
              '.asc': tr('Raster ASCII File (*.asc);;'),
          }
          # Open File Dialog
          file_path, __ = QFileDialog.getSaveFileName(
              self,
              tr('Output File'),
              current_file_path,
              extension_mapping[input_extension]
          )
          if file_path:
              self.output_path_line_edit.setText(file_path)
docs: Select output directory