Example #1
0
progress_handler = nfutil.progressbar_progress_observer()
save_handler = nfutil.forgetful_result_handler()

controller = nfutil.ProcessController(save_handler,
                                      progress_handler,
                                      ncpus=mp.cpu_count(),
                                      chunk_size=chunk_size)

multiprocessing_start_method = 'fork' if hasattr(os, 'fork') else 'spawn'

#==============================================================================
# %% TEST ORIENTATIONS - RUN BLOCK NO EDITING
#==============================================================================

raw_confidence = nfutil.test_orientations(image_stack, experiment, test_crds,
                                          controller,
                                          multiprocessing_start_method)

#==============================================================================
# %% POST PROCESS W WHEN TOMOGRAPHY HAS BEEN USED
#==============================================================================

grain_map, confidence_map = nfutil.process_raw_confidence(
    raw_confidence, Xs.shape, tomo_mask=tomo_mask, id_remap=nf_to_ff_id_map)

#==============================================================================
# %% SAVE PROCESSED GRAIN MAP DATA
#==============================================================================

nfutil.save_nf_data(output_dir,
                    output_stem,
            controller = nfutil.ProcessController(save_handler,
                                                  progress_handler,
                                                  ncpus=44,
                                                  chunk_size=chunk_size)

            multiprocessing_start_method = 'fork' if hasattr(
                os, 'fork') else 'spawn'
            global _multiprocessing_start_method
            _multiprocessing_start_method = 'fork'
            #==============================================================================
            #  TEST ORIENTATIONS WITHIN GRAIN
            #==============================================================================
            try:

                raw_confidence_mis = nfutil.test_orientations(
                    image_stack, experiment_g, test_crd_grain, controller,
                    multiprocessing_start_method)

                #==============================================================================
                # PUT DATA BACK INTO MESH
                #==============================================================================
                #full mesh test_crds
                print(
                    ' >>>>>>>>>>>>>>>>>>>>>putting data back in mesh>>>>>>>>>>>>>>>>>>>>>'
                )
                test_crd_all = np.vstack(
                    [Xs.flatten(), Ys.flatten(),
                     Zs.flatten()]).T

                raw_confidence_new = np.empty(
                    [experiment_g.n_grains,
Example #3
0
progress_handler = nfutil.progressbar_progress_observer()
save_handler=nfutil.forgetful_result_handler()
    
controller = nfutil.ProcessController(save_handler, progress_handler,
                               ncpus=mp.cpu_count(), chunk_size=chunk_size)

multiprocessing_start_method = 'fork' if hasattr(os, 'fork') else 'spawn'


#==============================================================================
# %% TEST ORIENTATIONS - RUN BLOCK NO EDITING
#==============================================================================


raw_confidence=nfutil.test_orientations(image_stack, experiment, test_crds,
                  controller,multiprocessing_start_method)
    
    

#==============================================================================
# %% POST PROCESS W WHEN TOMOGRAPHY HAS BEEN USED
#==============================================================================

grain_map, confidence_map = nfutil.process_raw_confidence(raw_confidence,Xs.shape,tomo_mask=tomo_mask,id_remap=nf_to_ff_id_map)



#==============================================================================
# %% SAVE RAW CONFIDENCE FILES 
#============================================================================