Beispiel #1
0
    def contour_explorer(writer, options, fng=None):
        if fng is None:
            fng = wx.FileNameGenerator(options.get('dir', '.'),
                                       options['pattern'])

        def create_contour_explorer():
            data = GetActiveSource()
            view = GetActiveView()
            explorer = wx.ContourExplorer(fng, data, options['contours'],
                                          options['range'], options['steps'])
            proxy = explorer.getContour()
            rep = Show(proxy)

            rep.LookupTable = options['lut']
            rep.ColorArrayName = options['contours']

            internal = writer(options['inner'], fng)

            class ContourProxy(object):
                def __init__(self, explorer, loopee):
                    self.explorer = explorer
                    self.loopee = loopee

                def add_attribute(self, name, value):
                    setattr(self, name, value)

                def UpdatePipeline(self, time=0):
                    for steps in self.explorer:
                        self.loopee.UpdatePipeline(time)
                    self.explorer.reset()

            return ContourProxy(explorer, internal)

        return create_contour_explorer
Beispiel #2
0
    def rotate_writer(options, fng=None):
        if fng is None:
            fng = wx.FileNameGenerator(options.get('dir', '.'),
                                       options['pattern'])

        def create_rotate_explorer():
            view = GetActiveView()
            return wx.ThreeSixtyImageStackExporter(
                fng, view, options.get('focal_point', [0, 0, 0]),
                options.get('distance', 100), options.get('axis', [0, 0, 1]),
                options.get('step', [10, 15]))

        return create_rotate_explorer
Beispiel #3
0
    def slice_writer(options, fng=None):
        if fng is None:
            fng = wx.FileNameGenerator(options.get('dir', '.'),
                                       options['pattern'])

        def create_slice_explorer():
            data = GetActiveSource()
            view = GetActiveView()
            return wx.SliceExplorer(fng, view, data, options['colors'],
                                    options.get('slices', 10),
                                    options.get('normal', [0, 0, 1]),
                                    options.get('viewup', [0, 1, 0]),
                                    options.get('bound_range', [0, 1]),
                                    options.get('scale_ratio', 2))

        return create_slice_explorer
Beispiel #4
0
        class Pipeline:
            RenderView1 = coprocessor.CreateView(CreateRenderView,
                                                 image_pattern, image_freq, 1,
                                                 1, 1547, 844)
            RenderView1.CacheKey = 0.0
            RenderView1.StereoType = 0
            RenderView1.UseLight = 1
            RenderView1.StereoRender = 0
            RenderView1.CameraPosition = [
                15000.0, 99592.9248046875, 647834.944767225
            ]
            RenderView1.StereoCapableWindow = 0
            RenderView1.CameraClippingRange = [
                441356.5953195527, 1361552.4689387335
            ]
            RenderView1.LightSwitch = 0
            RenderView1.ViewTime = 0.0
            RenderView1.Background = [0, 0, 0]
            RenderView1.CameraFocalPoint = [
                15000.0, 99592.9248046875, -200000.0
            ]
            RenderView1.CameraParallelScale = 219435.83080920158
            RenderView1.CenterOfRotation = [
                15000.0, 99592.9248046875, -200000.0
            ]

            RenderView1.ViewSize = resolution
            RenderView1.OrientationAxesVisibility = 0
            RenderView1.CenterAxesVisibility = 0

            # MANUAL: More datasets may be output with one run by:
            #   - making a new producer with a different 'dataset' value;
            #   - creating slice outputs involves making a new filename generator for
            #     it (to avoid overwriting other images) and creating a new writer
            #     using it and the other processor;
            #   - if a grid writer is wanted, don't forget to call SetActiveSource
            #     with the other dataset before creating it (sliceExplorer takes the
            #     dataset in, so the active source is ignored there).

            # Take an image of the dataset.
            mpas_ocean_00 = coprocessor.CreateProducer(datadescription,
                                                       dataset)

            if wx is not None:
                fileGenerator = wx.FileNameGenerator(
                    'slices', '{time}_{sliceColor}_{slicePosition}.png')

                def mkproxy(filegen, view, data):
                    def sliceFactory():
                        return wx.SliceExplorer(filegen, view, data,
                                                colorByArray, nslices,
                                                [0, 0, 1], [0, 1, 0],
                                                [0.2, 0.99], 2)

                    return sliceFactory

                # Writes slice files for web viewing.
                sliceExplorer = coprocessor.CreateWriter(
                    mkproxy(fileGenerator, RenderView1, mpas_ocean_00), '',
                    grid_freq)

            # Writes .pvtu files for viewing in ParaView.
            SetActiveSource(mpas_ocean_00)
            ParallelUnstructuredGridWriter1 = coprocessor.CreateWriter(
                XMLPUnstructuredGridWriter, grid_pattern, grid_freq)
Beispiel #5
0
def doProcessing(inputDir, outputDir, sizeOption):

    resolution = 500

    view = GetRenderView()
    view.ViewSize = [resolution, resolution]
    view.Background = [1.0, 1.0, 1.0]
    view.OrientationAxesVisibility = 0
    view.CenterAxesVisibility = 0

    fins_states = ['on', 'off']
    tube_states = ['on', 'off']
    vol_states = ['on', 'off']

    #angle_steps = [15, 15]
    angle_steps = [90, 90]

    centerOfRotation = {
        'shortFat':
        [0.03210659957176176, 0.03210659957176176, 2.08050000667572],
        'longFat':
        [0.1284263964244019, 0.1284263964244019, 2.2200000286102295],
        'longSkinny':
        [0.0064213199143523525, 0.0064213199143523525, 2.097312331199646]
    }

    rotation_axis = [0.0, 0.0, 1.0]

    distance = {'shortFat': 0.25, 'longFat': 1.16, 'longSkinny': 0.27}

    transformDims = {
        'shortFat': [5, 5, 1],
        'longFat': [20, 20, 1],
        'longSkinny': [1, 1, 1]
    }

    # -----------------------------------------------------------------------------
    # Input data definition
    # -----------------------------------------------------------------------------

    rodPaths = {
        'shortFat': 'rodShortest.vtk',
        'longFat': 'rodLong.vtk',
        'longSkinny': 'rodShorter.vtk'
    }

    rodPath = os.path.join(inputDir, rodPaths[sizeOption])
    blockFinsPath = os.path.join(inputDir, 'firstBlockFin.vtk')

    filePattern = {
        'shortFat': 'singlepin_shortest_%d.vtk',
        'longFat': 'singlepin_%d.vtk',
        'longSkinny': 'singlepin_clipped_%d.vtk'
    }

    #fileTimes = range(13) # all timesteps
    fileTimes = [7]

    fileNames = [
        os.path.join(inputDir, (filePattern[sizeOption] % time))
        for time in fileTimes
    ]

    # -------------------------------------------------------------------------
    # Pipeline definition
    # -------------------------------------------------------------------------

    # Rod Core
    rodCore = LegacyVTKReader(FileNames=[rodPath])

    # create a new 'Transform'
    rodTransform = Transform(Input=rodCore)
    rodTransform.Transform = 'Transform'
    rodTransform.Transform.Scale = transformDims[sizeOption]

    rodRep = Show(rodTransform)

    # Block Fins
    blockFins = LegacyVTKReader(FileNames=[blockFinsPath])

    # create a new 'Transform'
    blockTransform = Transform(Input=blockFins)
    blockTransform.Transform = 'Transform'
    blockTransform.Transform.Scale = transformDims[sizeOption]

    finsRep = Show(blockTransform)

    # Data pipeline
    reader = LegacyVTKReader(FileNames=fileNames)

    # create a new 'Transform'
    readerTransform = Transform(Input=reader)
    readerTransform.Transform = 'Transform'
    readerTransform.Transform.Scale = transformDims[sizeOption]

    dataRep = Show(readerTransform)

    velLUT = GetColorTransferFunction('vel')
    velLUT.RGBPoints = [
        0.0, 0.368627, 0.309804, 0.635294, 0.6000048000384004, 0.196078,
        0.533333, 0.741176, 1.2000096000768008, 0.4, 0.760784, 0.647059,
        1.800014400115201, 0.670588, 0.866667, 0.643137, 2.4000192001536016,
        0.901961, 0.960784, 0.596078, 3.0000240001920018, 1.0, 1.0, 0.74902,
        3.600028800230402, 0.996078, 0.878431, 0.545098, 4.200033600268802,
        0.992157, 0.682353, 0.380392, 4.800038400307203, 0.956863, 0.427451,
        0.262745, 5.400043200345603, 0.835294, 0.243137, 0.309804, 6.0,
        0.619608, 0.00392157, 0.258824
    ]
    velLUT.LockScalarRange = 1
    velLUT.ColorSpace = 'RGB'
    velLUT.NanColor = [0.500008, 0.0, 0.0]
    velLUT.ScalarRangeInitialized = 1.0

    # get opacity transfer function/opacity map for 'vel'
    #velPWF = GetOpacityTransferFunction('vel')
    #velPWF.Points = [0.0, 0.0, 0.5, 0.0, 4.471337795257568, 0.0, 0.5, 0.0, 5.1019110679626465, 1.0, 0.5, 0.0, 5.866241931915283, 0.0, 0.5, 0.0, 6.0, 0.0, 0.5, 0.0]
    #velPWF.ScalarRangeInitialized = 1

    dataRep.Representation = 'Volume'
    dataRep.ColorArrayName = ['POINTS', 'vel']
    dataRep.LookupTable = velLUT
    #dataRep.ScalarOpacityFunction = velPWF
    dataRep.ScalarOpacityUnitDistance = 0.0016956502318768525

    rodRep.ColorArrayName = [None, '']
    rodRep.DiffuseColor = [0.3333333333333333, 0.0, 0.0]
    rodRep.ScalarOpacityUnitDistance = 0.0043231046585508965

    finsRep.ColorArrayName = [None, '']
    finsRep.DiffuseColor = [0.6666666666666666, 0.3333333333333333, 0.0]
    finsRep.ScalarOpacityUnitDistance = 0.004452134850700366

    print "Going to set the distance to ", distance[sizeOption]

    fng = wx.FileNameGenerator(
        outputDir, '{time}/{fins}/{tube}/{volumeIdx}/{theta}_{phi}.jpg')
    exporter = wx.ThreeSixtyImageStackExporter(fng, view,
                                               centerOfRotation[sizeOption],
                                               distance[sizeOption],
                                               rotation_axis, angle_steps)

    hatFunctions = createHatFunctions()

    Render()

    for t in fileTimes:
        time = int(t)
        GetAnimationScene().TimeKeeper.Time = float(time)
        UpdatePipeline(time)

        dataRange = [0.0, 6.0]
        print "Moving to timestep ", time, ", new data range: ", dataRange

        for finState in fins_states:
            if finState == 'on':
                finsRep.Visibility = 1
            else:
                finsRep.Visibility = 0

            fng.update_active_arguments(fins=finState)
            fng.update_label_arguments(fins="Fins")

            for tubeState in tube_states:
                if tubeState == 'on':
                    rodRep.Visibility = 1
                else:
                    rodRep.Visibility = 0
                fng.update_active_arguments(tube=tubeState)
                fng.update_label_arguments(tube="Tube")

                for volumeIdx in range(4):
                    curRange = dataRange[1] - dataRange[0]
                    xPoints = hatFunctions[volumeIdx][0]
                    yPoints = hatFunctions[volumeIdx][1]
                    pwfPoints = []

                    for i in range(len(xPoints)):
                        pwfPoints.append(dataRange[0] +
                                         (xPoints[i] * curRange))
                        pwfPoints.append(yPoints[i])
                        pwfPoints.append(0.5)
                        pwfPoints.append(0.0)

                    newPwf = CreatePiecewiseFunction(Points=pwfPoints)
                    dataRep.ScalarOpacityFunction = newPwf

                    fng.update_active_arguments(volumeIdx=volumeIdx)
                    fng.update_label_arguments(volumeIdx="Idx")
                    exporter.UpdatePipeline(time)
Beispiel #6
0
def doProcessing(inputDir, outputDir, sizeOption):

    # -----------------------------------------------------------------------------
    # Configuration
    # -----------------------------------------------------------------------------

    data_to_process = {
        "velMagnitude": {
            "scalarRange": [0.0, 6.0],
            "contours": [5, 7, 8],
        },
        "helicity": {
            "scalarRange": [-10000, 10000],
            "contours": [-5000, 5000]
        }
    }

    resolution = 500

    #phis = [ float(r) for r in range(0, 360, 90)]
    #thetas = [ 0.0, 55.0 ]
    phis = [float(r) for r in range(0, 360, 20)]
    thetas = [-80.0, -60.0, -30.0, 0.0, 30.0, 60.0, 80.0]

    centerOfRotation = {
        'shortFat':
        [0.03210659957176176, 0.03210659957176176, 2.08050000667572],
        'longFat':
        [0.1284263964244019, 0.1284263964244019, 2.2200000286102295],
        'longSkinny':
        [0.0064213199143523525, 0.0064213199143523525, 2.097312331199646]
    }

    rotation_axis = [0.0, 0.0, 1.0]

    distance = {'shortFat': 0.25, 'longFat': 1.16, 'longSkinny': 0.26}

    transformDims = {
        'shortFat': [5, 5, 1],
        'longFat': [20, 20, 1],
        'longSkinny': [1, 1, 1]
    }

    streamRes = {'shortFat': 30, 'longFat': 30, 'longSkinny': 30}

    streamLength = {'shortFat': 0.15, 'longFat': 1.5, 'longSkinny': 0.099899}

    tubeRadius = {'shortFat': 0.006, 'longFat': 0.03, 'longSkinny': 0.0025}

    seedLinePoints = {
        'shortFat': {
            'point1':
            [0.024308765645997044, 0.0047357203659974655, 2.083430515514084],
            'point2':
            [0.03917303628210819, 0.05936205001834852, 2.083314811121571]
        },
        'longFat': {
            'point1':
            [0.09957288686644243, 0.01765718560781814, 2.103601091698531],
            'point2':
            [0.16402243492110558, 0.24191479837166693, 2.090316776204166]
        },
        'longSkinny': {
            'point1': [
                0.004460199538914286, -1.9721305484628665e-05,
                2.0837601391639593
            ],
            'point2':
            [0.0084706015358675, 0.012500996772009757, 2.084043910210548]
        }
    }

    # -----------------------------------------------------------------------------
    # Input data definition
    # -----------------------------------------------------------------------------

    rodPaths = {
        'shortFat': 'rodShortest.vtk',
        'longFat': 'rodLong.vtk',
        'longSkinny': 'rodShorter.vtk'
    }

    rodPath = os.path.join(inputDir, rodPaths[sizeOption])
    blockFinsPath = os.path.join(inputDir, 'firstBlockFin.vtk')

    filePattern = {
        'shortFat': 'singlepin_shortest_%d.vtk',
        'longFat': 'singlepin_%d.vtk',
        'longSkinny': 'singlepin_clipped_%d.vtk'
    }

    fileTimes = range(13)  # all timesteps
    #fileTimes = [ 12 ]

    fileNames = [
        os.path.join(inputDir, (filePattern[sizeOption] % time))
        for time in fileTimes
    ]

    # -----------------------------------------------------------------------------
    # Pipeline definition
    # -----------------------------------------------------------------------------

    # Rod Core
    rodCore = LegacyVTKReader(FileNames=[rodPath])

    # create a new 'Transform'
    rodTransform = Transform(Input=rodCore)
    rodTransform.Transform = 'Transform'
    rodTransform.Transform.Scale = transformDims[sizeOption]

    # Phony calculator to give a "value" to render by
    rodSolidCalc = Calculator(Input=rodTransform)
    rodSolidCalc.ResultArrayName = 'rodSolid'
    rodSolidCalc.Function = '1'

    extractRodSurface = ExtractSurface(Input=rodSolidCalc)
    rodSurfaceNormals = GenerateSurfaceNormals(Input=extractRodSurface)

    # Block Fins
    blockFins = LegacyVTKReader(FileNames=[blockFinsPath])

    # create a new 'Transform'
    blockTransform = Transform(Input=blockFins)
    blockTransform.Transform = 'Transform'
    blockTransform.Transform.Scale = transformDims[sizeOption]

    # Another phony calculator
    blockSolidCalc = Calculator(Input=blockTransform)
    blockSolidCalc.ResultArrayName = 'blockSolid'
    blockSolidCalc.Function = '2'

    extractBlockSurface = ExtractSurface(Input=blockSolidCalc)
    blockFinsSurfaceNormals = GenerateSurfaceNormals(Input=extractBlockSurface)

    # Data pipeline
    reader = LegacyVTKReader(FileNames=fileNames)

    # create a new 'Transform'
    readerTransform = Transform(Input=reader)
    readerTransform.Transform = 'Transform'
    readerTransform.Transform.Scale = transformDims[sizeOption]

    # create a new 'Calculator'
    calculator1 = Calculator(Input=readerTransform)
    calculator1.ResultArrayName = 'velMagnitude'
    calculator1.Function = 'mag(vel)'

    # Generate iso contours
    contours = {}
    for field in data_to_process:
        contours[field] = []
        for isoValue in data_to_process[field]['contours']:
            contours[field].append(
                Contour(Input=calculator1,
                        PointMergeMethod="Uniform Binning",
                        ContourBy=field,
                        Isosurfaces=[isoValue],
                        ComputeScalars=1))

    # -----------------------------------------------------------------------------
    # Pre-calculate ranges
    # -----------------------------------------------------------------------------
    globalRanges = {
        'helicity': [10000000, -10000000],
        'vel': [10000000, -10000000],
        'vorticity': [10000000, -10000000]
    }

    for time in fileTimes:
        t = int(time)
        print '  timestep ', t
        reader.UpdatePipeline(t)
        pdi = reader.GetPointDataInformation()

        for key in globalRanges.keys():
            globalRanges[key] = updateGlobalRange(
                pdi.GetArray(key).GetRange(), globalRanges[key])

    print 'Discovered global ranges:'
    print globalRanges

    # -----------------------------------------------------------------------------
    # Composite generator
    # -----------------------------------------------------------------------------

    fng = wx.FileNameGenerator(outputDir, '{time}/{theta}/{phi}/{filename}')

    camera_handler = wx.ThreeSixtyCameraHandler(fng, None, phis, thetas,
                                                centerOfRotation[sizeOption],
                                                rotation_axis,
                                                distance[sizeOption])

    iso_color_array = [('VALUE', 'helicity'), ('VALUE', 'vel'),
                       ('VALUE', 'vorticity'), ('VALUE', 'nX'),
                       ('VALUE', 'nY'), ('VALUE', 'nZ')]

    luts = {
        "helicity": ["point", "helicity", 0, globalRanges['helicity']],
        "vel": ["point", "vel", -1, globalRanges['vel']],
        "vorticity": ["point", "vorticity", -1, globalRanges['vorticity']],
        "rodSolid": ["point", "rodSolid", 0, [1.0, 1.0]],
        "blockSolid": ["point", "blockSolid", 0, [2.0, 2.0]],
        'nX': ['point', 'Normals', 0, (-1, 1)],
        'nY': ['point', 'Normals', 1, (-1, 1)],
        'nZ': ['point', 'Normals', 2, (-1, 1)]
    }

    filters = []
    filters_description = []
    color_by = []

    filters.append(rodSurfaceNormals)
    filters_description.append({'name': 'Rod'})
    color_by.append([('VALUE', 'rodSolid'), ('VALUE', 'nX'), ('VALUE', 'nY'),
                     ('VALUE', 'nZ')])

    filters.append(blockFinsSurfaceNormals)
    filters_description.append({'name': 'Block/Fins'})
    color_by.append([('VALUE', 'blockSolid'), ('VALUE', 'nX'), ('VALUE', 'nY'),
                     ('VALUE', 'nZ')])

    for field in contours:
        for iso in contours[field]:
            filters_description.append({
                'name':
                field[0] + "=" + str(iso.Isosurfaces[0]),
                'parent':
                "Contour by %s" % field
            })
            filters.append(iso)
            color_by.append(iso_color_array)

    groupNumber = 1

    ### Create streamlines

    # create a new 'Calculator'
    velScaler = Calculator(Input=readerTransform)
    velScaler.ResultArrayName = 'scaledVel'
    functionString = '(%d*vel_X*iHat)+(%d*vel_Y*jHat)+(vel_Z*kHat)' % (
        transformDims[sizeOption][0], transformDims[sizeOption][1])
    velScaler.Function = functionString

    # create a new 'Stream Tracer'
    pointPair = seedLinePoints[sizeOption]
    streamTracer = StreamTracer(Input=velScaler,
                                SeedType='High Resolution Line Source')
    streamTracer.Vectors = ['POINTS', 'scaledVel']
    streamTracer.MaximumStreamlineLength = streamLength[sizeOption]

    # init the 'High Resolution Line Source' selected for 'SeedType'
    streamTracer.SeedType.Point1 = pointPair['point1']
    streamTracer.SeedType.Point2 = pointPair['point2']
    streamTracer.SeedType.Resolution = streamRes[sizeOption]

    # create a new 'Tube'
    tube = Tube(Input=streamTracer)
    tube.Scalars = ['POINTS', 'AngularVelocity']
    tube.Vectors = ['POINTS', 'Normals']
    tube.Radius = tubeRadius[sizeOption]
    tube.VaryRadius = 'By Vector'
    tube.RadiusFactor = 0.1

    # create a new 'Extract Surface'
    extractTubeSurface = ExtractSurface(Input=tube)

    # create a new 'Calculator'
    calculator = Calculator(Input=extractTubeSurface)
    calculator.ResultArrayName = 'Normals'
    calculator.Function = 'TubeNormals'

    filters.append(calculator)
    filters_description.append({'name': 'Streamlines'})
    color_by.append(iso_color_array)

    # Create the image exporter
    exporter = wx.CompositeImageExporter(fng,
                                         filters,
                                         color_by,
                                         luts,
                                         camera_handler,
                                         [resolution, resolution],
                                         filters_description,
                                         format='png')  #, 0, 0)

    # Customize some view properties
    exporter.view.Background = [1.0, 1.0, 1.0]
    exporter.view.OrientationAxesVisibility = 0
    exporter.view.CenterAxesVisibility = 0

    # -----------------------------------------------------------------------------
    # Perform analysis
    # -----------------------------------------------------------------------------

    for t in fileTimes:
        time = int(t)
        GetAnimationScene().TimeKeeper.Time = float(time)
        fng.update_active_arguments(time=time)
        exporter.UpdatePipeline(time)
def doProcessing(inputDir, outputDir, sizeOption):

    resolution = 500

    view = GetRenderView()
    view.ViewSize = [resolution, resolution]
    view.Background = [1.0, 1.0, 1.0]
    view.OrientationAxesVisibility = 0
    view.CenterAxesVisibility = 0

    fins_states = ['on', 'off']
    tube_states = ['on', 'off']
    vol_states = ['on', 'off']

    #angle_steps = [15, 15]
    angle_steps = [90, 90]

    centerOfRotation = {
        'shortFat':
        [0.03210659957176176, 0.03210659957176176, 2.08050000667572],
        'longFat':
        [0.1284263964244019, 0.1284263964244019, 2.2200000286102295],
        'longSkinny':
        [0.0064213199143523525, 0.0064213199143523525, 2.097312331199646]
    }

    rotation_axis = [0.0, 0.0, 1.0]

    distance = {'shortFat': 0.25, 'longFat': 1.16, 'longSkinny': 0.27}

    transformDims = {
        'shortFat': [5, 5, 1],
        'longFat': [20, 20, 1],
        'longSkinny': [1, 1, 1]
    }

    # -----------------------------------------------------------------------------
    # Input data definition
    # -----------------------------------------------------------------------------

    rodPaths = {
        'shortFat': 'rodShortest.vtk',
        'longFat': 'rodLong.vtk',
        'longSkinny': 'rodShorter.vtk'
    }

    rodPath = os.path.join(inputDir, rodPaths[sizeOption])
    blockFinsPath = os.path.join(inputDir, 'firstBlockFin.vtk')

    filePattern = {
        'shortFat': 'singlepin_shortest_%d.vtk',
        'longFat': 'singlepin_%d.vtk',
        'longSkinny': 'singlepin_clipped_%d.vtk'
    }

    fileTimes = range(13)  # all timesteps
    #fileTimes = [ 12 ]

    fileNames = [
        os.path.join(inputDir, (filePattern[sizeOption] % time))
        for time in fileTimes
    ]

    # -------------------------------------------------------------------------
    # Pipeline definition
    # -------------------------------------------------------------------------

    # Rod Core
    rodCore = LegacyVTKReader(FileNames=[rodPath])

    # create a new 'Transform'
    rodTransform = Transform(Input=rodCore)
    rodTransform.Transform = 'Transform'
    rodTransform.Transform.Scale = transformDims[sizeOption]

    rodRep = Show(rodTransform)

    # Block Fins
    blockFins = LegacyVTKReader(FileNames=[blockFinsPath])

    # create a new 'Transform'
    blockTransform = Transform(Input=blockFins)
    blockTransform.Transform = 'Transform'
    blockTransform.Transform.Scale = transformDims[sizeOption]

    finsRep = Show(blockTransform)

    # Data pipeline
    reader = LegacyVTKReader(FileNames=fileNames)

    # create a new 'Transform'
    readerTransform = Transform(Input=reader)
    readerTransform.Transform = 'Transform'
    readerTransform.Transform.Scale = transformDims[sizeOption]

    dataRep = Show(readerTransform)

    helicityLUT = GetColorTransferFunction('helicity')
    helicityLUT.RGBPoints = [
        -10000.0, 0.368627, 0.309804, 0.635294, -7999.983999871999, 0.196078,
        0.533333, 0.741176, -5999.967999743998, 0.4, 0.760784, 0.647059,
        -3999.951999615997, 0.670588, 0.866667, 0.643137, -1999.935999487995,
        0.901961, 0.960784, 0.596078, 0.08000064000589191, 1.0, 1.0, 0.74902,
        2000.096000768006, 0.996078, 0.878431, 0.545098, 4000.112000896008,
        0.992157, 0.682353, 0.380392, 6000.12800102401, 0.956863, 0.427451,
        0.262745, 8000.14400115201, 0.835294, 0.243137, 0.309804, 10000.0,
        0.619608, 0.00392157, 0.258824
    ]
    helicityLUT.LockScalarRange = 1
    helicityLUT.ColorSpace = 'RGB'
    helicityLUT.NanColor = [0.500008, 0.0, 0.0]
    helicityLUT.ScalarRangeInitialized = 1.0

    helicityPWF = GetOpacityTransferFunction('helicity')
    helicityPWF.Points = [
        -10000.0, 0.2, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 10000.0, 0.2, 0.5, 0.0
    ]
    helicityPWF.ScalarRangeInitialized = 1

    dataRep.Representation = 'Volume'
    dataRep.ColorArrayName = ['POINTS', 'helicity']
    dataRep.LookupTable = helicityLUT
    dataRep.ScalarOpacityFunction = helicityPWF
    dataRep.ScalarOpacityUnitDistance = 0.0010386458757740604

    rodRep.ColorArrayName = [None, '']
    rodRep.DiffuseColor = [0.3333333333333333, 0.0, 0.0]
    rodRep.ScalarOpacityUnitDistance = 0.0043231046585508965

    finsRep.ColorArrayName = [None, '']
    finsRep.DiffuseColor = [0.6666666666666666, 0.3333333333333333, 0.0]
    finsRep.ScalarOpacityUnitDistance = 0.004452134850700366

    print "Going to set the distance to ", distance[sizeOption]

    fng = wx.FileNameGenerator(outputDir,
                               '{time}/{fins}/{tube}/{theta}_{phi}.jpg')
    exporter = wx.ThreeSixtyImageStackExporter(fng, view,
                                               centerOfRotation[sizeOption],
                                               distance[sizeOption],
                                               rotation_axis, angle_steps)

    Render()

    for t in fileTimes:
        time = int(t)
        GetAnimationScene().TimeKeeper.Time = float(time)
        UpdatePipeline(time)

        dataRange = [0.0, 6.0]
        print "Moving to timestep ", time, ", new data range: ", dataRange

        for finState in fins_states:
            if finState == 'on':
                finsRep.Visibility = 1
            else:
                finsRep.Visibility = 0

            fng.update_active_arguments(fins=finState)
            fng.update_label_arguments(fins="Fins")

            for tubeState in tube_states:
                if tubeState == 'on':
                    rodRep.Visibility = 1
                else:
                    rodRep.Visibility = 0

                fng.update_active_arguments(tube=tubeState)
                fng.update_label_arguments(tube="Tube")

                exporter.UpdatePipeline(time)