private Upload_Images_and_Segment_into_Events.Upload_and_Segment_Images_Thread data_transfer_obj; //this is our class which is responsible for data transfer from SenseCam to local machine...

        /// <summary>
        /// This method is responsible for starting the thread to upload and process new SenseCam images...
        /// </summary>
        private void initiate_data_transfer_process(string SenseCam_data_directory, string current_root_folder, bool uploading_direct_from_sensecam)
        {
            //firstly let's just check if it's ok to process this folder (i.e. user is sure this is what they want)
            bool ok_to_process = false, is_multiple_folder_upload = false;

            //check if this is a multiple past folder upload, ask the user if they're sure this is what they want to do
            if (!File.Exists(SenseCam_data_directory + "sensor.csv") && !File.Exists(SenseCam_data_directory + "image_table.txt")) //firstly let's see if they've selected a root folder...
            {
                //let's ask the user if they are sure they want to upload all sub
                MessageBoxResult user_agrees_to_process = MessageBox.Show("You are about to ingest all subfolders below this root folder and associated the images with this participant. Do not be alarmed if the percentage progress keeps resetting itself back to zero, this merely indicates it is starting to upload the next subfolder. Are you sure you want to continue with this operation?", "Upload Images from Multiple Folders?", MessageBoxButton.YesNo);

                //and then if they do agree to process, let's update our processing variable to say it's ok to process
                if (user_agrees_to_process == MessageBoxResult.Yes)
                {
                    ok_to_process             = true;
                    is_multiple_folder_upload = true; //and also let's just record that we're uploading multiple folders
                } //close if (user_agrees_to_process == MessageBoxResult.Yes)...
            } //close if (!File.Exists(SenseCam_data_directory + "sensor.csv"))...
            else
            {
                ok_to_process = true;  //if this is just a single folder with a .CSV file in it, then we know this is in all likelihood a SenseCam images folder, and we go ahead without prompting the user
            }
            if (ok_to_process)
            {
                data_transfer_obj    = new Upload_Images_and_Segment_into_Events.Upload_and_Segment_Images_Thread(Data_Transer_New_Info_Received_Callback, Data_Transfer_Processing_Finished_Callback, SenseCam_data_directory, current_root_folder, object_userID, uploading_direct_from_sensecam, is_multiple_folder_upload);
                data_transfer_thread = new Thread(new ThreadStart(data_transfer_obj.upload_sc_data));
                data_transfer_thread.IsBackground = true;
                data_transfer_thread.Start();

                //let's give some additional feedback on the UI that we're beginning to upload data...
                btnUpload.IsEnabled             = false;
                btnClose.IsEnabled              = false;
                btnUpload.Opacity               = 0.3;
                btnClose.Opacity                = 0.3;
                Loading_Animation.Visibility    = Visibility.Visible;
                photo_image.Visibility          = Visibility.Visible;
                grdPCDestinationIcon.Visibility = Visibility.Visible;
                sc_image.Visibility             = Visibility.Visible;
                lblUpload_Status.Visibility     = Visibility.Visible;
                lblUpload_Status.Content        = "0 %";
            } //close if (ok_to_process)...
        }     //close method Open_Heart_Rate_Sensor_Thread()...
        /// <summary>
        /// This method is responsible for starting the thread to upload and process new SenseCam images...
        /// </summary>
        private void initiate_data_transfer_process(string SenseCam_data_directory, string current_root_folder, bool uploading_direct_from_sensecam)
        {
            //firstly let's just check if it's ok to process this folder (i.e. user is sure this is what they want)
            bool ok_to_process = false, is_multiple_folder_upload=false;

            //check if this is a multiple past folder upload, ask the user if they're sure this is what they want to do
            if (!File.Exists(SenseCam_data_directory + "sensor.csv") && !File.Exists(SenseCam_data_directory + "image_table.txt")) //firstly let's see if they've selected a root folder...
            {
                //let's ask the user if they are sure they want to upload all sub
                MessageBoxResult user_agrees_to_process = MessageBox.Show("You are about to ingest all subfolders below this root folder and associated the images with this participant. Do not be alarmed if the percentage progress keeps resetting itself back to zero, this merely indicates it is starting to upload the next subfolder. Are you sure you want to continue with this operation?","Upload Images from Multiple Folders?",MessageBoxButton.YesNo);

                //and then if they do agree to process, let's update our processing variable to say it's ok to process
                if (user_agrees_to_process == MessageBoxResult.Yes)
                {
                    ok_to_process = true;
                    is_multiple_folder_upload = true; //and also let's just record that we're uploading multiple folders
                } //close if (user_agrees_to_process == MessageBoxResult.Yes)...
            } //close if (!File.Exists(SenseCam_data_directory + "sensor.csv"))...
            else ok_to_process = true; //if this is just a single folder with a .CSV file in it, then we know this is in all likelihood a SenseCam images folder, and we go ahead without prompting the user

            if (ok_to_process)
            {
                data_transfer_obj = new Upload_Images_and_Segment_into_Events.Upload_and_Segment_Images_Thread(Data_Transer_New_Info_Received_Callback, Data_Transfer_Processing_Finished_Callback, SenseCam_data_directory, current_root_folder, object_userID, uploading_direct_from_sensecam, is_multiple_folder_upload);
                data_transfer_thread = new Thread(new ThreadStart(data_transfer_obj.upload_sc_data));
                data_transfer_thread.IsBackground = true;
                data_transfer_thread.Start();

                //let's give some additional feedback on the UI that we're beginning to upload data...
                btnUpload.IsEnabled = false;
                btnClose.IsEnabled = false;
                btnUpload.Opacity = 0.3;
                btnClose.Opacity = 0.3;
                Loading_Animation.Visibility = Visibility.Visible;
                photo_image.Visibility = Visibility.Visible;
                grdPCDestinationIcon.Visibility = Visibility.Visible;
                sc_image.Visibility = Visibility.Visible;
                lblUpload_Status.Visibility = Visibility.Visible;
                lblUpload_Status.Content = "0 %";
            } //close if (ok_to_process)...
        }